toc

Team LiB
Next Section

Mac OS X Power Tools, Second Edition
Mac OS X Power Tools, Second Edition
by Dan Frakes ISBN:0782143199
Sybex © 2004 (640 pages)

Mac OS X Power Tools has been completely updated for version 10.3, Panther. This reference provides the hows and whys of OS, then shows you how to get the most out of it through specific examples.

Table of Contents
 | Mac OS X Power Tools, Second Edition
 | Introduction
 | Part I - Setup, Startup, and Installing
 | Chapter 1 | - | The Power of Permissions: Understanding Users and Unix Organization
 | Chapter 2 | - | Sensational Setup
 | Chapter 3 | - | Subjugating Startup and Leveraging Login
 | Chapter 4 | - | Installations, Inc.
 | Part II - Files, Finders, Docks, and Apps (Including Classic)
 | Chapter 5 | - | Finagle Files and Foil Finder Frustration
 | Chapter 6 | - | Developing a Dynamite Dock
 | Chapter 7 | - | Application Aptitude
 | Chapter 8 | - | Clobbering Classic
 | Part III - The Internet, Networking, Sharing, and Printing
 | Chapter 9 | - | Networking Notables and Internet Illuminations
 | Chapter 10 | - | Stellar Sharing Strategies
 | Chapter 11 | - | Connection Convenience and Remote Control
 | Chapter 12 | - | Printing Practicalities (and Fax Features)
 | Part IV - Mastering Your Mac—Security, Maintenance, and Unix
 | Chapter 13 | - | Strengthening System Security and Fine-Tuning Firewalls
 | Chapter 14 | - | Mac Maintenance and Administrative Actions
 | Chapter 15 | - | Utilizing Unix
 | Appendix A | - | Multiple Mounts, Various Volumes, and Divided Disks
 | Index
 | List of Figures
 | List of Tables
 | List of Sidebars

Team LiB
Next Section


backcover

Team LiB

Back Cover

The latest version of Mac OS X (v10.3, Panther) is here, and noted expert Dan Frakes has once again worked day and night to discover and document the best ways for Mac users -- of all experience levels to get things done. This completely revised and updated second edition of Mac OS X Power Tools provides tips, shortcuts, and step-by-step solutions to equip you with the most essential insights and knowledge. With this book at your side and your Mac in front of you, you’ll understand Mac OS X like never before, saving time, avoiding headaches, and transforming OS X into one very productive cat.

Coverage includes: Understanding users and permissions; Taking control of the startup and login processes; Embracing and extending Finder functionality; Using the Dock and Dock replacements; Working with applications; Streamlining Mac OS and third-party installations; Making the most of Classic; Improving Web surfing and network connectivity; Sharing files and connecting to servers; Taking advantage of OS X's advanced printing architecture; Strengthening system security; Keeping Mac OS X in tip-top shape; Controlling your Mac remotely; Taking advantage of OS X's Unix base.

Team LiB


Mac OS X Power Tools, Second Edition

Dan Frakes

Associate Publisher
Joel Fugazzotto

Developmental Editor
Brianne Agatep

Production Editor
Erica Yee

Technical Editor
James Bucanek

Copyeditor
Kim Wimpsett

Compositor
Maureen Forys
Happenstance Type-O-Rama

Proofreaders
Laurie O’Connell
Nancy Riddiough

Indexer
Ted Laux

Book Designer
Maureen Forys
Happenstance Type-O-Rama

Cover Designer/Illustrator
Richard Miller
Calyx Design

Copyright © 2004 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved. No part of this publication may be stored in a retrieval system, transmitted, or reproduced in any way, including but not limited to photocopy, photograph, magnetic, or other record, without the prior agreement and written permission of the publisher.

An earlier version of this book was published under the title Mac OS X Power Tools © 2003 SYBEX Inc.

First edition copyright © 2003 SYBEX Inc.

Library of Congress Card Number: 2003115673

ISBN: 0-7821-4319-9

SYBEX and the SYBEX logo are either registered trademarks or trademarks of SYBEX Inc. in the United States and/or other countries.

TRADEMARKS: SYBEX has attempted throughout this book to distinguish proprietary trademarks from descriptive terms by following the capitalization style used by the manufacturer.

The author and publisher have made their best efforts to prepare this book, and the content is based upon final release software whenever possible. Portions of the manuscript may be based upon pre-release versions supplied by software manufacturer(s). The author and the publisher make no representation or warranties of any kind with regard to the completeness or accuracy of the contents herein and accept no liability of any kind including but not limited to performance, merchantability, fitness for any particular purpose, or any losses or damages of any kind caused or alleged to be caused directly or indirectly from this book.

Manufactured in the United States of America

10 9 8 7 6 5 4 3 2 1

To my wife, Jennifer, for being everything to me.

Acknowledgments

(Or: The people I’ve remembered to thank, which is not necessarily everyone whom I should have thanked.)

Professional Thanks

First, thank you to the Sybex team: Brianne Agatep (every writer should be so lucky as to work with Brianne), Joel Fugazzotto (for his dedication to the book), Kim Wimpsett (for catching my errors), and Erica Yee (for getting the book out the door). And a big “thank you” to the rest of the Sybex staff who took a bunch of words and screenshots and turned them into the book you’re holding in your hands. It’s not an easy job, and I’m sure they don’t get thanked as much as they should.

Second, I want to thank James Bucanek, my technical editor. In the previous edition of this book I said, “I just hope he’s available the next time.” Luckily, he was, and he was once again invaluable both in catching my mistakes and omissions and in suggesting areas for improvement. James was also the coauthor of Chapter 15, and I credit him for most of the improvements we made in this edition. (Thanks to Chris Pepper for his hard work on the previous version!)

Thanks should also go out to everyone at Macworld Magazine (especially my most frequent editor, Jon Seff) and MacFixIt (especially Ben Wilson) for bearing with me when this book was dominating my schedule.

Thank you to Apple, and especially to Mike Shebanek for all his help.

I also want to thank the folks at DriveSavers (http://www.drivesavers.com/). In the middle of writing this book, I had a major computer disaster that caused the loss of a significant amount of data. Even worse, the incident also damaged my backups! DriveSavers was able to recover the vital data and get it back to me in a matter of days, thus ensuring that the book you’re reading was written to its potential.

Finally, I want to express my appreciation for the readers of (what is now called) the First Edition of Mac OS X Power Tools. Your purchases and positive feedback are responsible for this Second Edition being published. If you’re a “returning reader,” I hope you enjoy this version even more than the previous one.

Personal Thanks

To Ted Landau, for being both a friend and a sounding board: thank you. As we each worked on revisions of our own books in parallel, our “book conversations” helped keep me sane and on track; I hope they did the same for you!

To my friends and family, who surely wondered where I’d disappeared to during the writing of this book: thanks for understanding. I’m finally done and I hope to see you all much more frequently now!

Finally, to my wife, Jennifer, whose presence throughout the writing of this book and in my life in general was (and continues to be) a constant reminder of how good things can be: thank you for everything.

As this book is a revision of a previous edition, I haven’t stopped appreciating all the people I thanked in that edition. If you’re curious, you can see the acknowledgements from the First Edition on the book’s website at http://www.macosxpowertools.com/.


Introduction

(Or: The part of the book most people never read, but really should.)

You’re holding in your hands the Second Edition of Mac OS X Power Tools, completely revised from cover to cover. It includes full compatibility with the latest version of Mac OS X, new and updated tips, and lots of new information. Although the First Edition earned a good deal of praise, I think this one is even better. I hope that after spending some time with it, you’ll under- stand why.

Before you move on to the rest of the book, I urge you to take a few minutes to read this Introduction. I’ve included here information about the book’s approach and organization, tips for using it, conventions and styles used in it, and assumptions I make throughout. I promise you’ll enjoy the book more if you start here!

What This Book Is

When Sybex first approached me—prior to the First Edition—about writing a book called “Mac OS X Power Tools,” I kept thinking about power drills, circular saws, and other shop machinery. But the more I thought about it, the more I realized how appropriate the title was to the content of the book I wanted to write.

Power tools, in the world of hardware stores, serve two purposes: (1) to let you do something that you wouldn’t ordinarily be able to do; and (2) to help you do things that you can do, but do them faster, better, and with much less effort. Looked at in this light, the title of this book is actually quite fitting, as I plan to show you how to do things with Mac OS X that you probably don’t know how to do (or can’t do), and to help you better do the things that you know how to do already.

Throughout this process, my goals are twofold. First, as I mentioned, I want to show you how to do things. Things you already know how to do, but want to do better, faster, or more efficiently; things you always wished you could do, but didn’t know how; and things you never even thought about doing, but once you learn will make you think “Wow, that’s cool!” I’ll do this in a number of ways: I’ll answer questions that don’t get answered anywhere else. I’ll show you how to take advantage of features in OS X that are easily accessible but rarely fully understood or utilized. I’ll show you how to access features of OS X that exist, but are hidden or not immediately obvious. Finally, I’ll show you third-party software solutions that do all of the above and also provide new and unique features and functionality.

My second goal, which may actually be a bit loftier but more important, is to help you learn how to think about doing things in OS X. Through the background principles I provide on each topic, and the examples I use to demonstrate those principles, I hope to give you a better understanding of the operating system itself—how it works, why it works, and how you can take advantage of it. After learning these principles, and seeing some of the things you can do, you should have a better feel for the kinds of things that are possible (or at least a better idea of where to look to see if they are).

Who Should Read This Book

The overall theme of Mac OS X Power Tools is to help proficient users become power users. However, the problem with using a word like proficient is that it’s such a broad term—its meaning varies depending on who’s using it. To some people, being able to turn on your computer on, type a letter, and print is enough to be considered a proficient user. To others, being proficient means possessing the ability to troubleshoot computer problems, install new software and hardware, and take advantage of more advanced features in applications and the operating system. I say that both of these definitions are accurate, and I’ve written this book to appeal to both sets of users (and anyone in between). Unless you’re a complete novice, you should find lots of great stuff inside.

Again, the “power tools” analogy is fitting. Someone who’s never seen a screwdriver, much less used one, would probably be a bit intimidated by a power drill (not to mention feeling clueless as to how to go about using it). Yet someone who’s used a screwdriver—even just a few times—will probably deduce what a power drill with a screwdriver bit could be used for, and may even be willing to try using it. What’s more, in the hands of an accomplished handyman or -woman, that power drill can do some pretty amazing things.

So it is with Mac OS X Power Tools. If you’ve never touched a computer before, this book probably isn’t for you. But everyone else—whether they consider themselves a beginner or a more advanced user— should find a good deal of content that is understandable and appropriate. The tips, tricks, and solutions I present vary in both their utility and their accessibility. Some will amaze the beginner but will be old hat to experts. Some will be useful to everyone, whereas others will be applicable (and interesting) mainly to more advanced users. Likewise, some chapters, by the very nature of their subject matter, will be more or less technical in nature than others. For example, the chapters on the Finder and Dock (Chapters 5–6) are much less “techie”—although no less useful—than the chapter on Unix (Chapter 15). If something is too basic for you, feel free to move on to more advanced topics; likewise, if something confuses you, come back to it later—you may find that it makes more sense as you learn more about OS X.

All this is to say that if you’re the least bit comfortable with a computer, you’ll be able to handle this book, and that even those who already consider themselves to be “power users” will likely find a lot of stuff here that they didn’t know.


What This Book Isn't

Team LiB

What This Book Isn’t

I’ve tried to give you a good idea about what this book is, but I should also make clear what this book isn’t.

First, it isn’t a troubleshooting book. Although in Chapter 14 I cover a number of maintenance tasks you can perform to keep your Mac humming along, and throughout the book I discuss a few of the most common issues users experience with OS X, the truth is that including substantial content dedicated to troubleshooting would have taken space away from topics that address the book’s focus. (Granted, understanding how OS X works is the best “first step” you can take towards knowing how to fix it when it doesn’t work; in that light, after reading this book you should be a better troubleshooter than when you first picked it up. However, I wanted to concentrate on how to make your Mac work better, rather than how to get it working when it doesn’t.) If you’re looking for a book on troubleshooting, the best one out there, in my opinion (although I’m biased, since I wrote part of it), is the eponymous Ted Landau’s Mac OS X Help Line. It’s also one of the best books on the market at explaining the intricate details of Mac OS X. If you don’t want to buy an entire book on troubleshooting, Apple’s Knowledge Base has a helpful article on the topic at http://docs.info.apple.com/article.html?artnum=25392, and there’s an excellent summary of common problems and solutions at http://www.macattorney.com/panther.html.

Second, although I’ve tried to make this book accessible and useful for many types of users by bridging the usual gap between “learning OS X” books and “tips and tricks for OS X” books, this is also not an “absolute beginner” book. I touch on the basics the first time I mention each topic, and explain concepts thoroughly when I feel it’s necessary, but then I move on to more advanced information. I assume that you’ve used a computer before, even if for just a little bit, and that you’re familiar with the basics: turning it on, opening a folder or document, using menus in applications, dragging files around, etc. If you’re not comfortable doing these types of things, I recommend spending a bit more time with your Mac before you dive in. If you want some recommendations for books to get you started, my favorites are Mac OS X: The Missing Manual by David Pogue (for true beginners) and Mastering Mac OS X by Todd Stauffer (a bit “meatier”). Both take you through the most basic of basics, but also delve into more advanced topics when you’re ready. (If you’re instead at the other end of the spectrum and you want a mammoth tome that’s more focused on the advanced, nitty-gritty details, you should check out Mac OS X Unleased by John Ray and William C. Ray; at around 1600 pages, it will keep you busy!)

Third, this isn’t a hardware book; it’s a book about the operating system and software that is Mac OS X. There may be occasions here and there where I point out certain hardware features that are (or are not) supported on various Mac models, but that’s about it. I won’t spend time talking about your Mac’s hardware, how to install new hardware, or how to fix hardware problems.

Finally, this book isn’t comprehensive—and I mean that in a good way! If you don’t see a way to do something in this book, that doesn’t mean it can’t be done. Likewise, if you do see a way to do something, that doesn’t necessarily mean it’s the only way to do it. There are a lot of other ways to get more out of OS X, and that’s the beauty of it. I’ve tried to put together what I feel is a great collection of information, tips, tweaks, and software gems that will help you get the most out of your Mac. If I’m lucky, the background and ideas you get from this book will inspire you to think of even better ways to accomplish the things you need to do. In addition, websites like http://www.macosxhints.com/ are filled with new tips and information on a daily basis.


How to Use This Book

  1. Open book to desired page.

  2. Read.

  3. Buy more RAM.

OK, so that was silly. But seriously, before you dive in, I’d like to briefly talk about the assumptions I make in this book, the book’s organization (which is a bit untraditional), and conventions used in the text. Taking a few minutes to read this section will make the book much more useful. (By the way, I’m serious about the RAM thing—if you’re using OS X, the best thing you can do for your Mac is to buy more RAM.)

Assumptions I Make

As I mentioned above, I’m assuming that if you’re reading this book you’ve previously used a computer (and I hope Mac OS X)—at least enough so that you can understand the basics. For example, I’m assuming that you know how to restart your computer, how to use the CD/DVD drive, how to connect the keyboard, etc. I’m also hoping that you’ve become at least somewhat familiar with the Mac OS interface. Overall, I’m simply assuming that you’ve got a Mac that’s up and running and that you feel comfortable using it for most basic functionality. Making this assumption lets me spend less time explaining the most introductory topics—which generally take up a good deal of space—and more time on the cool stuff. It also lets me structure the book a bit differently, as I explain in the next section.

Second, I’m assuming that you’re connected to the Internet—that your ISP or network administrator has provided you with the information you need to connect, and that you’ve used Apple’s setup assistant to enter that information. (If you knew enough about Internet settings and access to figure everything out yourself, more power to you.)

Finally, a small number of the procedures in the book assume that you’ve installed the Mac OS X Developer Tools. (I talk about how to install them later in this Introduction; rest assured that it’s very easy to do if you haven’t done it already.)

How the Book Is Organized

Most computer books start out by telling you how to open folders, how to access menus, how to launch applications, and other “This is how you use a computer” topics. Some start out with detailed instructions on how to install the OS. Because I’m assuming you’re already familiar with such basic actions and you’ve already got OS X installed, I’m able to forego the discussion of the most basic topics, and replace the traditional topic order with one that I think is more appropriate given the focus of Mac OS X Power Tools.

Part I starts with an in-depth discussion of user accounts, permissions, and file and folder organization in OS X. As a Unix-based operating system, understanding OS X is much easier if you understand these topics, and mastering OS X requires it. You’re of course free to read the book’s chapters in any order that you like, but I urge you to read Chapter 1 first. In the remainder of Part I, I show you how to understand and use OS X’s various system settings, how to use and abuse the startup and login processes, and how to install and update system software and applications, from both Apple and third parties.

Part II focuses on actually using your Mac: the Finder, the Dock, applications, and the Classic Environment. (An Online Supplement to Chapter 5 is also available from the book’s website at http://www.macosxpowertools.com/.)

Part III looks at networks and the Internet, including network setup, browsing, sharing files, connecting to—and controlling—other computers (both locally and remotely), and printing.

Part IV deals with more advanced topics: system security, maintenance and administrative tasks, and taking advantage of OS X’s Unix base.

I’ve also included a couple of useful appendices, one here and one on the book’s website. The first (here in the book) focuses on setting up and using multiple volumes and disk partitions in OS X. The second (the online one) talks about OS X versus OS 9, including ways to make the transition easier, tips for switching back and forth (if that’s something you need to do), and ways to get some of your favorite OS 9 features in OS X.

To make it easier for you to find information, I’ve provided both a general index and a list of software mentioned in the book. The general index is right where you’d expect it in the back of the book. However, because URLs change so frequently, the software listing resides on the book’s website (http://www.macosxpowertools.com/); it includes every software title mentioned in the book, along with links to get more information and/or to download each. (Note that software titles are also listed, with page references, in the main index. In addition, the first time I mention a software title in the book, I provide a URL for that title.)

Finally, the book’s website also features a good deal of other supplemental material that simply wouldn’t fit in the print edition!

Conventions Used in the Book

To make the content of Mac OS X Power Tools easier to read and understand, I’ve used a number of standardized conventions in the book’s text and interface. Below is a summary of those conventions for you to use as a reference. Some may seem obvious as you read them here, but in the context of topical discussion they’ll help make clear exactly what I’m talking about.

“Tip Tables”

As you may know, or will soon find out as you read this book, OS X is a true multi-user operating system, with different levels of users (normal, administrator, and root), each of which has different abilities. (I cover user levels and abilities in detail in Chapter 1.) As a result, some methods of using, configuring, and customizing OS X can be performed by any user, but some can only be performed by admin users or the root user. In addition, some ways of customizing and configuring OS X affect all users of the computer, whereas others affect only the particular user making the change.

Although these user levels and configuration possibilities make OS X incredibly flexible, they can also make a book such as this confusing, since a particular user may or may not be able to take advantage of a particular tip or example, and if they can, the results of that procedure may end up unintentionally affecting other users of the same computer.

In addition, although most ways of working with OS X can be accomplished via a graphical user interface (GUI)—pointing and clicking the mouse and typing text into dialogs—some require the use of Terminal, OS X’s command-line interface to its Unix subsystem. (I’ll talk more about Terminal throughout the book, and I dedicate much of Chapter 15 to using it). Some users love the fact that they can use Terminal; others hate it. I hope by the time you finish this book, you’ll—at the very least—respect it for what it can do, but in the meantime you may want a “heads up” if you’re going to need to use it.

For all of these reasons, I decided to implement what I call tip tables. At the beginning of each section, example, or procedure, I provide a table that looks something like this:

User Level | any, admin, or root
Affects | individual user or computer
Terminal | yes or no

The User Level field tells you, up front, whether or not the procedure or topic can be undertaken by any user of a computer, only by an administrator, or only by the root user. The Affects field tells you whether or not any change you make using the information or instructions that follow will affect just your own user account, or the entire computer (all users). Finally, the Terminal field tells you whether or not you’ll need to use Terminal in order to take advantage of the cool info I present in that section. (If a procedure or tip doesn’t include a tip table, you can assume that the tip table for the higher-level section enclosing that procedure/tip applies.)

As far as I know, Mac OS X Power Tools is the first book on OS X to take this approach; I hope it encourages others to do the same, as I feel it clears up one of the most confusing issues surrounding the customization of OS X.

Note, Tip, and Warning Boxes

Throughout the book you’ll see text boxes that provide additional information. These boxes contain tips, notes, and warnings; here is an example of each, along with its significance:

Tip

Tips point out additional functionality or options relating to the topic being discussed, or tell you how you can use the preceding or surrounding content in other ways.

Note

Notes present interesting information or further resources about the topic being discussed.

Warning

Warnings point out very important information that you should know and consider about the topic being discussed. A failure to read and heed such warnings could result in unexpected behavior or, in some situations, data loss!

Start Sidebar
What’s a Sidebar?

Sometimes a topic doesn’t quite “fit” anywhere else in a chapter, but is still important enough to include in the book. In these situations, I discuss the topic in a sidebar that looks suspiciously like what you’re reading right now.

End Sidebar

Terminology for Actions

In many sections of this book, I explain how to perform specific actions in OS X (often using step- by-step instructions). To avoid confusion, I’ve tried to be very consistent in the terms I use, especially when referring to parts of OS X’s user interface. Although most of these actions should be obvious, there are a few situations where distinctions are important:

Choose refers to menus and menu items (including pop-up menus). For example, I might tell you to choose the Open command from the File menu. In addition, I use the Ø symbol to guide you through a menu. For example, the phrase “choose File Ø Open in the Finder” means than you should switch to the Finder, click on the File menu, and then choose the Open item. Similarly, if I tell you to “choose your preferred printer from the Printers pop-up menu,” it means to click on the pop-up menu next to the word Printers, place your mouse cursor over your preferred printer, and click the mouse again to choose it.

Select refers to selecting items in the Finder and selecting files or items in lists. If I tell you to “select a file” in a Finder window, it means you should click on that file to highlight (select) it. Likewise, if you open the Displays panel of System Preferences, you’ll see a list of available resolutions for your display; select one by clicking on it.

Press refers to keys on the keyboard. For example, if I tell you to press return, that means you should press and release the return key on the keyboard. If I tell you to hold a key as you complete an action (click or move the mouse, type a letter, etc.), it means you should hold that key down until the action is complete.

Finally, click refers to clicking the mouse on an interface element. For example, if a dialog box has a button for “OK,” I’ll tell you to “click the OK button” or “click OK.” In addition, if I tell you to control-click, it means you should hold down the control key as you click the mouse. Shift-click means to hold down the shift key as you click the mouse. And so on…if you see click presented with any keyboard keys, you should hold them down as you click the mouse.

Typefaces

To distinguish between the standard text of the book and text that refers to special content, I use special typefaces for the latter:

  • New or key terms are presented in standard italics. In addition, file and folder names and interface options are sometimes italicized to distinguish them from surrounding text.

  • Filepaths (discussed below) are presented in this typeface. If part of a filepath requires user input (for example, the user's username), that part will be italicized. URLs are also presented in this typeface to distinguish them from surrounding text. When typing a URL, include only the text in this typeface.

  • Text that the user needs to type into a dialog or other text field, precisely as it is presented, is generally bolded. Similar text that requires the user to provide “custom” information (such as their name or a filename) is italicized.

  • Commands or input that the user must type into Terminal are presented in this typeface. If a command requires user-provided information (a username or filename, for example), that section of the command is italicized.

  • Examples of Terminal output (text that is presented to you by Terminal after entering a command) are presented in this typeface.

As a side note, most interface elements (names of menus, buttons, check boxes, etc.) are presented in standard text; however, if there is a chance that an interface element’s label might be confused for regular text, I enclose it in quotations. For example, the label Save is fairly clear, but the phrase “Add to list” may not be; the latter is enclosed in quotes.

Miscellaneous

In addition to the conventions mentioned in the previous sections, here are a few other miscellaneous standards I use throughout the book:

  • I use the terms folder and directory interchangeably. Folder is most likely more familiar to users of Mac OS 9 and earlier, as well as to Windows users, whereas directory is probably more familiar to Unix users; in Mac OS X, they generally mean the same thing.

  • Macs have always come with a single-button mouse, but for a number of years now, Mac users have been able to hold the control key down as they click the mouse—in the Finder or from within applications—to get a contextual menu. This is commonly referred to as control-clicking. However, Mac OS X supports multi-button mice, which means if you’ve purchased a mouse that has more than one button, you can use the left-most button for standard clicks and the right-most button for contextual menus without installing any additional drivers. This is known as right-clicking. Because some users will have the stock Apple mouse, and some will have a third-party mouse, I use the phrase control/right-click to indicate that you can use either the control key method or the right-most mouse button.

  • A pathname is the formal name for the path you would take to get to a file from the top level of your computer’s file system. For example, if you want to access a file called filename inside your personal Documents folder, the pathname would be /Users/username/Documents/filename. (Notice how I used those typefaces I was just telling you about.) The beginning / signifies the top level of your hard drive, and each subsequent / signifies a sub-folder.

  • When typing text into Terminal, or into most interface fields, the case of that text matters. For example, as you’ll see later in the book, typing /Users is not the same thing as typing /users. So be sure to pay attention to case when I instruct you to type something.

  • One of the most confusing things about writing books where you try to instruct the reader to type text into Terminal or any other command-line interface is that it’s often difficult for the reader to figure out exactly what they should be typing. Is a period part of the command, or is it just punctuating a sentence? Is a command on two lines because it’s actually two different commands, or was it just too long to fit on one line? To avoid such confusion, I conclude every command-line input with <RETURN>. Anything preceding this marker is part of the command, on a single line, and anything after this marker is not part of the command. (In addition, when I present a line of code or a Terminal command on its own line and it ends up being too long to fit on a single line, I use the symbol å to indicate that two or more lines here in the book are actually continuations of a single line or command.)

  • Although this Second Edition of Mac OS X Power Tools is generally focused on OS X 10.3 and later, many of the tips, and much of the information, apply to earlier versions of OS X, as well. If information applies to only a specific version or versions of OS X, I’ll indicate this information in the text. For example, if I mention “10.2.6” it means I’m referring specifically to that particular version of OS X 10.2. If I say 10.3 or 10.3.x it means all variants of version 10.3— 10.3.0, 10.3.1, 10.3.2, 10.3.3, etc.; likewise with 10.2.x,10.1.x, and so on. Related to this, if I say “as of OS X 10.3, “ this means “beginning with OS X 10.3 and in every version since.” (It’s identical to saying “in OS X 10.3 and later.”)

  • Related to the previous point, in many areas, Mac OS X 10.3 and earlier versions of Mac OS X work similarly, but use different words or labels to designate the same things—menu commands, interface options, etc. I generally use the labels/wording from OS X 10.3, unless they’re different enough to cause confusion, in which case I try to point out such differences.

  • In Mac OS X 10.2 and earlier, many applications and utilities provided access to different screens/panels using tabs—this interface looked almost like tabbed manila file folders; clicking a tab switched to that screen/panel. In OS X 10.3, Apple changed this interface so that the tabs look more like buttons. However, I still call them tabs here in the book, as they function identically. In general, a tab switches between views in a window; a button performs an action.

  • Finally, speaking of screens and panels, I use these two terms when a single window provides access to a number of different views/sections/panels. For example, the Finder’s Get Info window has several panels that can be viewed independently. Similarly, the Network Utility application provides many different views; you switch between them using the tabs at the top of the window. I call each of these different window views screens or panels.

Installing Apple’s Developer Tools

Apple provides—for free—a set of “developer” software tools, applications, documentation, and support files to encourage people to write software for Mac OS X. They call this package the Developer Tools or Xcode Tools. I mentioned earlier that these tools are required for some of the tips and procedures I describe in the book. The truth is that they’re only required for a very small proportion of the exercises I show you, so if you don’t install the Developer Tools, you’ll be fine. However, because you might want to take advantage of those tips, and because installing the Developer Tools provides you with a number of very useful tools that you can’t get anywhere else, I highly recommend it. (Don’t be intimidated by the term “Developer Tools”—there’s nothing scary about them, and they’re very easy to install.)

There’s a good chance that you already have the Developer Tools installer and don’t even know it. Check the CDs that came with your Mac or—if you bought OS X separately—that came with Mac OS X. If one says “Developer Tools” or “Xcode Tools,” you’ve got ‘em. Insert the CD, double- click the installation package, and follow the instructions. If OS X was pre-installed on your Mac, you should instead check to see if you have an /Applications/Installers folder; if you do, double-click the file called Developer.mpkg to install the Developer Tools.

If you don’t already have the Developer Tools, you can download them at no charge by signing up for a free Online Developer membership at http://developer.apple.com/membership/online.html. Once you’ve signed up, you can log in to the Developer site and follow the links to download software. Unfortunately, the download is pretty darned big, so if you have a slow Internet connection, I’d start the download before you go to bed so it will be finished when you wake up in the morning. When it’s complete, double-click the downloaded image and follow the instructions to install. (I talk more about installing software in Chapter 4.)

(Actually, it’s a good idea to sign up for a free Online Developer account even if you already have the Developer Tools installer, because Apple periodically releases updated versions of developer software that aren’t available via Software Update.)


Software Mentioned in the Book

Throughout Mac OS X Power Tools, I introduce you to a good deal of software, from both Apple and third-party vendors. These products tend to be my favorites for the tasks at hand; I don’t guarantee that you won’t like something else better, but you can rest assured that I’ve tried out almost every option available at the time of this writing and presented you with what I feel is the cream of the crop. Occasionally, when two or more products accomplish the same thing but I feel that the differences are more matters of preference than quality, I’ll provide multiple solutions so that you can choose for yourself.

Whenever I mention a product, I provide you with a URL to get more information about it (or to download it). However, as you surely know if you’ve spent much time on the Web, URLs change, and a few of the URLs included in this book are probably going to have changed by the time you read it. If the URL for a product isn’t working, I recommend using one of the OS X software websites such as http://www.versiontracker.com/macosx/ or http://www.macupdate.com/ to get an updated URL. Both sites let you search for software by title, and will provide you with a link to the developer’s website and, usually, a download link.

You can also view a complete list of software titles mentioned in Mac OS X Power Tools, including live links to each title’s “home page,” on the book’s website, http://www.macosxpowertools.com/. I’ve even noted which are my favorites.

Note

When I describe a particular software title, keep in mind that my comments are based on the product at the time of this writing; software is updated regularly, so there’s a chance that a feature I say doesn’t exist actually does by the time you read this (or vice versa). In fact, one of the exciting things about Mac OS X is that new and updated software titles are being released on a daily basis!

Shareware, Donationware, etc.

Some of the software I cover in this book is commercial—software you have to buy to use. Other titles are freeware—the developer has released the software for use at no charge. However, a good deal of software falls under the categories of shareware and donationware. Shareware are titles that allow you to use them for some set amount of time (e.g., 15 days or a month) in order to evaluate them. If you find that you use them, you’re expected to pay for them (using the procedures the developer has provided, usually through a secure payment system such as http://www.kagi.com/). Sometimes payment gets you additional functionality, as well. Donationware is similar to shareware, except that the software is fully functional when you download it, and instead of requiring a payment, the developer asks for a donation if you find the software useful.

As a former shareware author/developer myself, I can’t stress enough how important it is to actually pay for the software you use. Shareware and donationware developers generally do what they do because (1) they love to do it; and (2) the traditional software distribution systems are prohibitively expensive. Yet neither of these reasons means they don’t deserve to be paid for their work. The quality of many shareware/donationware titles is comparable to, or even better than, that of “commercial” software you would buy in a box at a store. In addition, in my experience, many shareware/donationware developers provide better support to their customers than many commercial developers do. Getting paid not only rewards them for what they’ve done; it also encourages them to keep doing it.

If you end up trying out a piece of software I mention in the book, pay for it (or, in the case of donationware, donate a little something). It’s good for the developers, it’s good for the Mac platform, and it’s good for your software karma.

Note

After trying out so many software titles, I’ve come up with a few suggestions for developers for improving the way they distribute OS X software. Check out the book’s website if you’re interested.

Tools Used to Write This Book

I generally don’t spend much time thinking about writing tools. Or if I do, I’m thinking about them only because of all the problems they cause (as was the case with the word processor used to write this book). However, since I’m on the topic of software, I want to briefly mention a few tools I used in the writing of Mac OS X Power Tools that truly enhanced the creative process. First, the content database DEVONthink (http://www.devon-technologies.com/products/devonthink.php) made organizing and searching the daunting amount of information I collected and created far easier than I thought possible. Second, the outlining app OmniOutliner (http://www.omnigroup.com/applications/omnioutliner/) has become my "writer’s best friend." It’s not only a great outline creator; it’s also a flexible outline editor, which was especially important as I frequently changed the way I structured chapters (or the book as a whole). Finally, like most Mac writers I’m grateful for Snapz Pro X (http://www.ambrosiasw.com/), the Mac OS X version of the venerable screenshot standby. OS X has some impressive screenshot capabilities (which I discuss in Chapter 7), but they’re no match for Snapz Pro X’s feature set and flexibility.


Errors, Feedback, and Contact Info

The book’s editors and I have endeavored to weed out errors and inconsistencies, and I hope we’ve been successful. However, a fact of life in publishing is that minor errors sometimes slip through. In addition, each time Apple releases an update to OS X, there’s a chance that something that worked before no longer does, or that a specific functionality will work a bit differently. If I find errors or a need for clarification, I’ll post them on the book’s website, http://www.macosxpowertools.com/. In fact, just to be on the safe side, you should check the website before you dig in, to see if any important information has been posted. If you actually find an error, please let me know about it by sending an e–mail to errors@macosxpowertools.com.

I also welcome feedback from readers: what you like about the book, what you dislike, what you’d like to see more of (or less of), and any suggestions you might have for a future edition. Feel free to send any comments to feedback@macosxpowertools.com. I can’t guarantee a response; however, I do guarantee that your feedback will be read and appreciated.


Finally...

Team LiB

Finally…

I wrote Mac OS X Power Tools because I love the Mac OS and the things it can do. I probably spend far too much time figuring out exactly what those things are, but I’m excited at the chance to pass on some of this knowledge to you. I hope that you have as much fun reading this book as I did writing it.

Dan Frakes
http://www.danfrakes.com/


Part I: Setup, Startup, and Installing

Chapter List

Chapter 1: The Power of Permissions: Understanding Users and Unix Organization
Chapter 2: Sensational Setup
Chapter 3: Subjugating Startup and Leveraging Login
Chapter 4: Installations, Inc.


Chapter 1: The Power of Permissions: Understanding Users and Unix Organization

(Or: What the heck are user accounts and privileges, and how do I use them to my advantage?)

Overview

It may seem odd to start a book about becoming a power user of Mac OS X with such boring topics as user accounts, file/folder organization, and file permissions. After all, you’re in this to learn cool tips and tricks, not to learn about the boring guts of the operating system, right? Yet when it comes down to it, if you don’t understand these topics, you’ll never become the master of your Mac. In addition, in my experience working with users of OS X (especially those users who have come to OS X from previous versions of the Mac OS), one of the most frustrating—and common—issues they have is dealing with permissions (such as error messages telling them they can’t do what they want to do because they “don’t have permission”). This means that some of the most useful tips and tricks relate to permissions and user accounts.

In addition to gaining a better understanding of these issues, in this chapter you’ll learn how to create and customize user accounts and groups, how to work with permissions, and how to use NetInfo Manager. You’ll also learn about root access and the root account.


The Basics: Permissions, Accounts, and File Organization

Because of its Unix heritage, Mac OS X is a true multi-user operating system from the ground up. Yet some people have used Mac OS X for many months without fully realizing what this means—as the only user of their Mac, they press the power key, and it simply boots up and runs, much like a Mac running OS 8 or OS 9. To many other users, a multi-user OS just means that several people can use the Mac without sharing the same Documents folder and preference files.

The truth is that the multi-user architecture of Mac OS X offers so much more than separate Documents folders. It’s a powerful system of files, folders, and volumes, with varying degrees of access to those items given to individual users. Everything from setting preferences to installing software, from opening files to emptying the trash is affected by this system; as a result, OS X provides levels of security and flexibility heretofore unseen on the Mac platform. Understanding the concepts of user accounts and permissions, and understanding the file structure of Mac OS X, are the first steps toward becoming a true Power User. In fact, understanding these topics is vital to mastering many of the topics discussed later in the book.

Because these issues are important, and because Mac OS X accommodates so many different levels of users, I’ll start at a more basic level in this chapter than in subsequent chapters to ensure that I thor- oughly explain these concepts. Consider this chapter the foundation on which you’ll build your power user skills.

Permissions Explained

Users of Mac OS 9 and earlier may remember setting up File Sharing privileges—when File Sharing was enabled, each “shared” file had a set of privileges, set manually by the user sharing that file, that told the OS which remote users could access it. Because Mac OS X is based on Unix, it inherits the Unix system of file permissions (also called privileges). This system is similar to File Sharing privileges, except that in OS X every file and folder has a set of permissions (some set by users, but most set by the OS itself), and these permissions apply to everyone, whether they’re connecting remotely or sitting in front of the host computer. To put it simply, OS X keeps track of which users can open each document, folder, or application and which users can edit each file. (In OS X, the terms you probably know as open and edit are technically called read and write, respectively.)

You can see an example of permissions by selecting a file in the Finder (a document in your Documents folder is a good one to choose) and then selecting File Ø Get Info. In the resulting Info window, you’ll see a section called Ownership & Permissions. Clicking the disclosure triangle will expand this section to show the permissions you have for this file; clicking the disclosure triangle next to Details will show the overall permissions given to the file. Figure 1.1 shows the Info window for a document from my Documents folder.

The owner of the file is me, frakes, and I have Read & Write access to the file. You also see two other sets of permissions: Group and Others. In addition to an owner (the user who controls access to the file—generally the person who created it), every file belongs to a group, which is simply a defined subset of all users who have their own access privileges to the file. The group is automatically set to the default group for the owner—in this case, frakes—and set to “Read only.” These settings can actually be changed to provide certain other users with a particular level of access, without opening up such access to everyone. (I’ll talk more about groups and group access—as well as why the owner and the group might be the same—later in this chapter, but for now just remember that they’re there; they can be quite useful once you learn how to use them.) Finally, the Others permission setting is used to set privileges for users who are neither the owner of the file nor part of the group assigned to the file; think of this as “everyone else.” The default setting for others is Read only. (See “What Permissions Really Mean” for more info on the various levels of access.)

Note

Mac OS X permissions are not enforced under Mac OS 9. If you reboot into OS 9, you’re free to do anything you want to any file you want—and so is anyone else.

Figure 1.1: The Ownership & Permissions section of the Info window for sample.doc

Understanding what permissions are isn’t too difficult; comprehending how they work and why they work the way they do can be quite confusing. The first step toward that goal is understanding user accounts.

Start Sidebar
What Permissions Really Mean

Read & Write sounds cute, but what does it really mean? Here’s a rundown of what the different permissions levels mean for different types of items:

File

Read & Write You can open the file to read it or edit it, or you can make a copy of it. If the enclosing folder allows, you can also move it (deleting a file is considered moving it).

Read only You can open the file to read it, and you can make a copy of it (the copy will acquire Read & Write status). If the enclosing folder allows, you can also move the file.

No Access You cannot open or edit the file. However, if the enclosing folder allows, you can make a copy of the file or move it. You can still see the file, provided you have Read access to the enclosing folder (next item).

Note that the ability to delete a file is controlled by the permissions of the enclosing folder, not the permissions of the file itself. If you have Read & Write access to a folder (see below), you can delete files within that folder, regardless of the privileges you have for the individual files.

Folder

Read & Write You can open the folder and edit the contents of the folder (copy items to it, move items out of it, delete items from it, duplicate items within it, rename items within it, etc.).

Read only You can open the folder and view its contents, and you can make a copy of the folder (the copy acquires Read & Write status). If the enclosing folder allows, you can also move the folder. You cannot add to or remove its contents, and you can’t rename any of its contents. However, you can change the permissions or ownership of files/folders within the folder, provided you have Read & Write access to those items.

No Access You can’t open the folder (and, therefore, you can’t view its contents).

Write only (Drop Box) This permission level applies only to folders; an example is ~/Public/Drop Box (see "Understanding User Accounts" for more information about such folders). If you have "Write only" access to a folder, you can add items to it, but you can’t open the folder to view its contents. This is where the term Drop Box comes from—all you can do is drop files/folders inside, like a postal mailbox.

Application

Although an application in Mac OS X looks like a single file, it’s often actually a folder containing the application itself and the application’s support files; the technical name for this type of folder is a package. (See Chapter 4 for more information about packages.) When you double-click a package (or select it and choose File Ø Open in the Finder), the application is launched. Because of this type of organization, permissions on an application work much like permissions on a regular folder:

Read & Write You can launch the application and view the application package contents (by control/right-clicking the application and then selecting Show Package Contents from the resulting contextual menu). You can also edit the package contents (copy items to it, move items out of it, duplicate items within it, etc.), and move the application/package and its contents (including deleting it/ them).

Read only You can launch the application and view the application package contents, and you can make a copy of the application. You cannot edit/change the application package’s contents. If the enclosing folder allows, you can move the application/package or edit its contents.

No Access You cannot launch the application, nor can you view its package contents. You can only see the application itself if the enclosing folder provides you with Read or Read & Write access.

End Sidebar

Understanding User Accounts

Mac OS 9 and earlier were essentially single-user operating systems. Sure, Mac OS 9 had the less- than-perfectly-implemented Multiple Users feature, but it was just that—less than perfect. Mac OS X is a true multi-user system, meaning that whether you realize it or not, you’re no longer the only user of your machine. In the sections that follow, I’ll explain what “multiple users” means in a practical way: how files and folders are organized, what users do and don’t have access to, and more.

User Accounts and File/Folder Organization

At the topmost level of your Mac OS X hard drive (this is called the root level of the drive and designated in Unix terminology as /), you’ll see a folder called Users. This folder contains all user-level files for all users of your computer. Within this folder, each user has their own individual folder, the name of which is their "short" username. (I’ll talk more about short and long usernames in a bit.) This folder is called the user’s home folder or directory (and is generally identified by the abbreviated pathname ~/). Thus, on my computer, my home directory is located at /Users/frakes. Within each home folder are several fold- ers that were automatically created when the user account was created: Desktop, Documents, Library, Movies, Music, Pictures, Public, and Sites (Figure 1.2). In addition, a user’s home folder can also contain any other files and/or folders that the user has placed there or that OS X has created there.

Click To expand
Figure 1.2: A typical home user folder

The important thing to note about home directories under OS X is that with the exception of the Public and Sites folders (which are accessible by other users), files, folders, or applications stored inside your home folder are for your eyes only, and unless you explicitly change their permissions, no one but you will be able to edit them, or even view them. Your user folder is yours and yours alone. In fact, the Desktop that you see is actually a folder called Desktop within your user folder. This means that, unlike OS 9, each user has their own Desktop. In fact, anything you save or copy to the Desktop will actually reside in the Desktop folder inside your home directory and, thus, will be visible and accessible only to you.

However, user folders aren’t just for security. They also provide an enormous amount of flexibility between users. In addition to documents, folders, and applications, user folders also store each user’s preferences (in ~/Library/Preferences). This means that any settings or changes you make to your Mac—your desktop picture, your email account information, your web browser bookmarks—will apply only to you, allowing each user to customize OS X to best serve their own needs. When you log in, the OS uses your preferences and restores the environment to exactly the state it was in when you last logged out. This is important to note because it means that as you go through this book, many of the neat tricks and customizations you find will only apply to your personal account, thus preventing you from annoying or disrupting other users.

Note

When I said that all preferences apply only to the user who set them, that wasn’t entirely true. There are a few exceptions to this rule; for example, network settings apply to all users and therefore can only be changed by an administrator. I’ll talk more about which settings are system-wide in Chapter 2, “Sensational Setup.”

Start Sidebar
Dissecting the Contents of Your Home Directory

Although your home directory (/Users/username, or the more common designation of ~/) contains any files, folders, or applications that you personally place there, it also includes a number of folders that were automatically created when your account was created. Here’s a quick list of the default folders and a few common additions, as well as the purpose of each :

Applications This folder may not actually exist in your home folder, because Mac OS X doesn’t create it by default. Some application installers create it during installation, and some users create it on their own. I suggest creating it yourself it if doesn’t exist, as any applications that you install here will be available only to you—if you have an application that you need to use but you don’t want other users of your computer to be able to access, install it here. (If you want to this folder to be created automatically for all new user accounts, edit the new user template as explained at the end of this sidebar.)

Desktop This is your personal Desktop. If you open this folder, you’ll notice that its contents are exactly the same as the items visible on your Desktop. In Mac OS X, each user has their own Desktop, and anything placed on the Desktop is actually placed inside this folder.

Documents This folder is the “official” location for storing personal documents and files. Most applications will default to storing files here. Although you aren’t required by OS X to store your personal files here—you can store files elsewhere if you want—I highly recommend it for a few reasons. First, it makes backing up your important documents easier because you can just back up this folder instead of worrying if you have included all of your files in your backup routine. (I talk more about backing up in Chapter 14.) Second, it makes finding your documents easier—you simply open this folder in the Finder instead of searching all over your drive. (You can create as many folders and subfolders inside this folder as you want if it helps you better organize your files.)

Faxes If you’re running Mac OS X 10.3 and later and enable fax reception, OS X creates this folder for storing received faxes. (I’ll talk more about faxing in Chapter 12.)

Library This folder contains many of the support files and resources used by the OS when you are logged into your account. Any preferences, system add-ons, fonts, and other files and information used only by your account are located here. (See “Why Are There So Many Copies of So Many Folders?” later in this chapter for more information.)

Movies OS X creates this folder as a convenient place to store any movies/projects you create with iMovie.

Music This folder is used, by default, as a place for iTunes to store your iTunes Music Library and music files.

Pictures In addition to being a convenient place to store photos, your iPhoto Library is stored in this folder.

Public This folder and its contents are viewable and readable by all users, both local and remote. In addition, inside the Public folder is a folder called Drop Box—this folder provides others with “Write only” access, meaning they can give files to you by placing them in this folder, but they can’t open the folder or view its contents. (I go into much more detail about the Public folder in Chapter 10.)

Sites This folder is where you store documents you want to make available via Mac OS X’s built-in Web server. (More details about this feature are also contained in Chapter 10.)

Editing the New User Template

When you create a new user, the contents of the new user’s home directory include, by default, the following folders: Desktop, Documents, Library, Movies, Music, Pictures, Public, and Sites. However, you may want an Applications folder, or some other folder, to be created by default. The contents of a newly created home directory are dictated by the folder templates located at /System/Library/User Template. Inside this directory are home directory templates, one for each language supported by your installation of OS X (English.lproj is the template for English). If you open one of these template folders, you’ll see the standard folders of a new home directory. Any changes you make to the contents of this directory will be reflected in any new user account. For example, to have an Applications folder created by default, create a new folder here and change its permissions to owner: system, Read & Write access; group: wheel (a default Unix group that includes admin users), No Access; and others: No Access. (Note that to create a new folder here, you’ll need root access, either in Terminal or in the Finder, which I’ll talk about later in this chapter in "Getting to the Root of It.")

End Sidebar

User Levels

As I previously mentioned, every user of Mac OS X has their own account. Each of those accounts has one of two levels of access: normal and administrative.

Normal users Normal users (called Standard users in some places in OS X 10.3 and later) have full access to their own user folder and to other users’ Public folders. They can also launch applications located in the /Applications directory and can change user-specific System Preferences (desktop picture, views, Dock settings, as well as their own account password). However, that’s basically the extent of their access. Outside of their own user folder, they have only Read access (except for other user folders, for which they have no access at all). In fact, a normal user can’t even create a folder or save a document outside of their own home folder. (And an administrative user can actually restrict the account of a normal user to have even less access; OS X 10.3 calls these users Managed or Simplified users. I’ll talk about this functionality later in this chapter in "Creating, Editing, and Deleting User Accounts.")

Admin users Administration users don’t have complete run of the house, but they’re much less limited than normal users. Admin users can install new applications in the /Applications direc- tory, can change system-level System Preferences (Network, Accounts, Sharing, Software Update, etc.), can install system-wide add-ons, can create folders and save documents almost anywhere on the drive, and can use system-level utilities such as Disk Utility and NetInfo Manager. The first account created under Mac OS X (the one you created when you first installed OS X) is an admin- level account by default, since every Mac OS X computer must have at least one administrator.

You can view user levels in the Accounts pane of the System Preferences application (Figure 1.3). I’ll talk more about using the Accounts pane when I talk about creating and editing user accounts, later in this chapter.

Click To expand
Figure 1.3: User levels, as shown in the Accounts panel of System Preferences

Despite having a higher level of access, not even admin users can access other users’ private folders, nor can they make changes to certain system-level folders (such as much of the System folder at the root level of the hard drive)—at least not without help. Although I said there are only two levels of accounts in Mac OS X, this is technically not true. There’s a third level of access in OS X called root access that has complete control over everything, regardless of permission or location. However, you can’t simply assign root privileges to particular accounts; Mac OS X actually has a separate root account (which always exists but is disabled by default for obvious security reasons). To gain root access, you must actually log in as the root user or use one of several techniques for temporarily gaining root access from an administrator account; I discuss all of these procedures later in this chapter in “Getting to the Root of It.”

Note

Users can also authenticate, as described later in this chapter, in order to perform certain actions that they wouldn’t otherwise be able to do.

It’s important to understand the differences between these levels of access , as many of the tips discussed in this book require admin access, and some require at least temporary root access. As I mentioned in the Introduction, I’ve noted the level of access required for each procedure described in the book.

Other Uses for User Accounts (besides Other Users, That Is)

User Level | admin
Affects | computer
Terminal | no

At this point you may be saying to yourself, “OK, I’m the only user of my computer, and I have admin access by default, so why do I need to know about user accounts?” That’s a good question. In addition to the importance understanding user accounts and permissions has for fully understanding OS X as a whole, there are several reasons I recommend creating other user accounts that have little or nothing to do with multiple human users:

Troubleshooting Although Mac OS X is incredibly stable, the truth is sometimes things go wrong. When you experience a computer problem, the first step you should take toward finding a solution is to narrow down the possible causes. In Mac OS 9, you held the shift key down to start up without extensions; if your Mac then worked fine, you had isolated the problem to a startup file conflict. In Mac OS X, because each user account has a different set of preferences, support files, and startup/login files, the first thing you want to do is to find out if your problems are caused by your account or by a larger system issue. A helpful way to do this is to create a new account (right now, before you have problems), name it something clever (I call mine Troubleshooting User, or trouble for short), and then never use it…until you have a problem. If that happens, log out of your own account, log back in under your troubleshooting account, and see if the problems are gone. If they are, you’ve just isolated your problem to something in your own account (~/Library files, Login/Startup Items, etc.), and that’s where you should start looking for the cause. If the problems still exist, then at the cause is at the system level.

Tip

In Mac OS X 10.3 (Panther), you can take advantage of Fast User Switching (discussed later in this chapter) to use your troubleshooting account without even logging out of your own account.

I also recommend that you give your troubleshooting account admin access, as discussed later in this chapter when I discuss creating and editing accounts. If you ever find yourself in an emergency where you need admin access but you can’t log into your normal admin-level account, having an extra admin account can be a lifesaver.

Testing software If you’re an aspiring power user, chances are that at some point you’ve down- loaded “beta” software (or even—gasp—”alpha” software). In other words, you’ve tried out software that isn’t quite ready for prime time. Although a lot of beta software is very stable, some isn’t, and you may have experienced crashes or other problems. Even if you’re not that brave, at some point you may have installed software just to check it out and later decided that you didn’t really like it, but you couldn’t figure out how to get rid of all the support files that the software installed. My approach to these situations is to create an extra user account just for testing software. You can run the alphas, betas, and “just curious” software from this account until you’ve either decided you want to use it in your main account or decided you want to get it off your Mac as soon as possible. Whatever you decide, your personal account—the important one you can’t afford to screw up—should be unaffected. (One exception is if the software in question installs system-level files or otherwise affects the entire system. Even multiple users can’t help you out in that case.)

Guests We’ve all had a friend who needs to borrow our laptop to type up a report, or asks to use our computer to do their taxes, or is just hanging out and wants to surf the Web. We let them (because we’re nice people, of course), but the next time we sit down at our computer we find that our Desktop is a mess, or our application preferences have been changed, or, worst case scenario, an important document was accidentally deleted! A great solution is to create an extra account, call it Guest (or something a bit more clever), and then set it up for just these situations. I’ve got my guest account configured with limited access (see “Creating User Accounts” later in the chapter) and with just the essentials in the Dock: Web browser, word processor, spreadsheet, etc. You can even set up the guest account without a password so that anyone visiting or borrowing your computer can simply click the Guest icon at login and be on their way.

Remote access and file sharing In addition to allowing others to use your computer locally (sitting down at it), user accounts also control who can access your Mac remotely (over the Inter- net or via your home or office LAN). If you want someone to be able to access files on your computer, that person generally must have a user account on your computer—even if they’ll never use the computer in person. (I’ll talk more about remote access and file sharing in Part III, “The Inter- net, Networking, Sharing, and Printing.”)

As you can see, “multiple users” doesn’t necessarily mean “multiple people using the computer.” I hope these suggestions will get you thinking about other ways to take advantage of the security and flexibility provided by multiple user accounts.

Why Are There So Many Copies of So Many Folders? (OS X File/Folder Organization)

I previously discussed the flexibility that user accounts provide, especially in providing a way for users to customize their individual computing environments. However, this versatility also creates new challenges that aren’t present in single-user operating systems. For example, what if you or another administrator of your Mac wants to install a system add-on or utility and wants the effects or features of that software to be applicable to all users? Or, at the opposite extreme, what if some software needs low-level access to the operating system and needs to ensure that nosy users don’t remove installed files?

Fortunately, the way Mac OS X is organized provides solutions to these dilemmas. Unfortunately, this organization can be quite confusing for the new user (and even for experienced users). If you truly want to master Mac OS X, understanding how files are organized is just as important as understanding permissions and user accounts; many of the tips and tricks discussed in this book require that you be familiar with OS X’s file system. With that in mind, in the next section I’ll explain the various fold- ers and folder levels and their purposes.

Domain/Directory Levels

If you’ve done any digging around on your OS X hard drive, you’ve most likely discovered a number of “identical” folders in different places. In reality, these similarly named folders aren’t identical; they actually serve different, but parallel, purposes. This parallel structure is due to the fact that Mac OS X has three different levels of system and user support, called domain levels. These three levels are known as the system, local, and user domains. Each of these domains provides a different level of support, and a different degree of access to its files and folders; a summary of each follows:

System The system domain is represented by the directory /System at the root level of your hard drive Figure 1.4. The contents of this folder (which are effectively the contents of /System/Library, as that is usually the only folder contained in /System) comprise the entire operating system. With a few exceptions, everything inside was installed by the Mac OS X installer or by Apple updaters (those exceptions being a few third-party installers that require very low-level access to the OS). The contents of this folder are protected by the OS and aren’t easily modified—and for good reason: modifying files in the /System directory is the easiest way to screw up your computer! If you want to witness this security in action, try deleting a file or folder, such as /System/Library/Keyboard Layouts. (Go ahead, try to drag that folder to the trash, I’ll wait….) If you’re running OS X 10.3 or later, you’ll see an Authenticate dialog that says, "Finder requires that you type your password." (Click the Cancel button in the dialog—you don’t really want to delete the file/folder in this example!) This is OS X’s way of saying, "Are you sure you want to do that? It’s an important file." Typing your admin-level username and password basically gives you temporary root access and allows you to delete the file. (If you’re running OS X 10.2 or earlier, you’ll see an error message that says, "The operation could not be completed because this item is owned by root.")

Click To expand
Figure 1.4: The system-level Library folder

Basically, unless you have root access, most of the /System directory is off-limits (at least without authenticating). Think of it as the foundation of the OS—you can remodel what’s on top of it, but you don’t want to start messing with the foundation itself unless you really know what you’re doing.

Local The local domain is represented by the /Library and /Applications folders (at the root level of your hard drive). See Figure 1.5. These directories provide a way for administrators to provide resources to all local users of the computer. You’ll notice that the contents of /Library look similar to the contents of /System/Library. Whereas almost everything inside/System/Library is installed by the OS X installer, /Library is largely populated by support files and system add-ons installed by administrators or software installers. The /Applications folder contains any applications you or another administrator have installed there; just as the resources in /Library are available to all users, the applications installed in /Applications can be used by all users. Although the contents of these two folders aren’t modifiable by a normal user, any administrator can make changes.

Click To expand
Figure 1.5: The local-level Library folder

User The user domain is represented by each user’s home folder (~/) (Figure 1.6). As described in the sidebar "Dissecting the Contents of Your Home Directory," each user folder has its own Library directory (referred to by the path ~/Library). Although support files and other resources located in the ~/Library folder function in much the same way as files located in /Library and /System/Library (and the folders inside ~/Library look very similar to those in the other two Library directories), those in ~/Library, the user-level directory, are available only to the particular user whose user folder contains them. Likewise, if a user creates their own Applications folder as suggested earlier in the chapter, any applications installed in ~/Applications will be available only to that particular user.

Click To expand
Figure 1.6: The user-level Library folder
Start Sidebar
Understanding Authentication Dialogs

Authentication dialogs—dialog boxes that pop up and ask you for a username and password—are fairly common in OS X. They generally appear when you attempt to do something that only an administrator, or the root user, should be doing. Sometimes they appear automatically; other times they appear when you specifically request to be authenticated—for example, when you click a “padlock” icon in a Get Info window, a utility, or System Preferences.

These dialogs are a way for the current account to temporarily be given a higher level of access, so that you can do things you wouldn’t normally be able to do from within that account. When you see an authentication dialog, simply type an admin-level username and password and then press return. (Note that you don’t have to provide the username and password for the account that’s currently logged in; any admin account will do. This can be useful if the current account doesn’t have admin access; any admin user of the computer can type their own name and password in order to provide “one-time” authorization for the action in question.)

Authentication dialogs also serve a more practical function: They’re a “virtual nudge” to you, the user. When an authentication dialog pops up, it’s a sign that you’re doing something serious—and potentially dangerous. Consider what you’re trying to do, and make sure you really want to perform the action.

As a side note, one helpful feature of authentication dialogs is that they notify you if the caps lock key is active via a caps lock icon (passwords are case-sensitive, so this is a nice touch).

End Sidebar

Files generally get installed in ~/Library or ~/Applications for two reasons. First, when an admin decides that they want to make certain files or applications available only to themselves or to a particular user, the administrator will install files in their own or a particular user’s directory. Second, recall that a normal user can’t modify any folder outside of their home directory. Thus, if a normal user wants to install an application, system add-on, or other /Library-level file, they must use their own ~/Library and ~/Application directories.

Note

There’s actually a fourth domain level in Mac OS X, the Network domain. If you’re connected to a network— most likely a local area network) (LAN)—a central server can host this Network domain, and the corresponding Library and/or Application directories. This /Network/Library directory can contain resources and support files available to all users on the network (and /Network/Applications can host applications for all users on the network). However, as such a configuration is rare for the average user of Mac OS X, and the presence of such a Network domain doesn’t really affect the discussion at hand, I don’t spend much time on it.

A good example of a group of parallel folders that illustrates the concepts discussed in this section is the way Mac OS X stores fonts. Fonts that are installed by the Mac OS X installer are stored in /System/Library/Fonts. Fonts installed by applications, or by administrators for use by all users, are located in /Library/Fonts. Fonts installed by a single user, or by an administrator for use by only a single user, are located in ~/Library/Fonts. All users can take advantage of fonts stored in /System/ Library/Fonts and /Library/Fonts, but user-level fonts (those stored in ~/Library/Fonts, inside the user’s home directory) are only accessible by the user in whose home directory the fonts are located.

Another good example of parallel folders is the folders that hold preference files. The folder /Library/Preferences contains system-level preference files that affect all users, such as login window preferences, sharing and firewall preferences, power management preferences, and serial numbers for applications available to all users. These preferences generally require administrative access to change. Each user also has their own ~/Library/Preferences folder, holding all of their own preference files. Having parallel folders for preferences is actually quite powerful (and flexible), as it allows for both personal and system-wide preferences. (You’ll notice that there are relatively few preference files in /Library/Preferences; this is a testament to how much of OS X is configurable by each user individually. Also note that there’s no /System/Library/Preferences directory. This makes sense if you think about it, since /System shouldn’t be modified.)

What do these domain levels mean to you? First, you should now have a better idea of how OS X keeps track of single-user versus all-user versus system-level files. But perhaps more important for this book, understanding these domains should help you understand how changes you make to files or folders will affect your own user account, other user accounts, or the system as a whole. You also now know where to put something or edit something depending on which accounts you want to affect. This knowledge will come in handy as you experiment with various tips and tricks throughout the book.

The Man behind the Curtain: NetInfo

If you’ve come to Mac OS X from earlier versions of the Mac OS, you may be wondering where OS X stores all of its information on users, user accounts, and the like. The answer is a database called the NetInfo database. Since you’ll be working with this database at various points in this book, it will helpful to you if I talk briefly about what it is, what it does, and how to work with it.

What Is NetInfo?

NetInfo is a system-level (meaning it can’t be modified without administrator or root access) database that (in Apple’s own words) “facilitates the management of administrative information used by Mac OS X computers.” This data includes information on all user accounts (usernames, file locations, group memberships, etc.), groups, access levels, network domain information, file sharing services, printer information, and more. Basically, any kind of network-related data (remember, in Mac OS X, even local accounts are “network-related”) is stored in the NetInfo database.

The information in the NetInfo database is stored hierarchically: A root NetInfo domain contains various directories, and each directory can contain further directories or properties, which are the actual settings stored in the database. For example, the full name for my user account, Dan Frakes, is stored in a property in the NetInfo database, called realname, located at /users/frakes/realname. Note that although NetInfo paths look very much like file paths (/Users/frakes), they aren’t the same. They simply look similar because both NetInfo and the Mac OS X file system are organized hierarchically.

Some of the information in the NetInfo database is maintained by the system and is accessible and edited via other methods (user accounts, for example, are set up via the Accounts pane of System Preferences, as explained later in this chapter). However, certain information, such as groups and group membership, is only configurable by editing your NetInfo database. How to do this is our next topic of discussion.

Tip

NetInfo is actually a pretty complicated system—too much so to go into more detail here. However, Apple has provided a rather thorough description of it in a PDF document called Understanding and Using NetInfo, which you can download from http://docs.info.apple.com/article.html?artnum=106416 or http://www.apple.com/server/pdfs/UnderstandingUsingNetInfo.pdf.

Working with NetInfo

The NetInfo database is physically located at /var/db/netinfo/local.nidb, but you can’t access the database in the Finder without root access. So how do you work with it? There are actually two ways: Terminal and NetInfo Manager. Of course, given the importance of the data managed by NetInfo, both methods are available only to an admin-level user.

Warning

Making changes to your NetInfo database can have drastic consequences if you make a mistake. The information stored in the database is vital to your Mac’s operation, and making changes to items you aren’t familiar with can cause problems such as not being able to access files or not being able to boot up your computer. Before making any changes to NetInfo, you should back up your NetInfo database as described in “Backing Up and Restoring the NetInfo Database.”

Terminal

You can access and edit your NetInfo database from the command line using the Terminal application (/Applications/Utilities/Terminal). In fact, OS X has a built-in Terminal command for doing so: niutil (which stands for NetInfo utility). Using this command, you can create, rename, and delete NetInfo settings, as well as find out current settings. You’ll actually use this command later in the book (in Appendix A).

However, although using Terminal to edit your NetInfo database is fast and convenient if you know exactly what you want to do (including exactly which property you want to modify), it’s not very intuitive for those who aren’t experts in the various directories and properties managed by Net- Info. A better solution can be found in the NetInfo Manager application.

NetInfo Manager

The NetInfo Manager application (/Applications/Utilities/NetInfo Manager) provides a graphical interface to the NetInfo database. It allows you to quickly view current database settings and— with administrative access—to change, add, or delete settings. Although the complete range of things you can do with NetInfo Manager is beyond the scope of this book, I want to briefly show you how it works, since you’ll be using it at various points in the book to do NetInfo-related things.

To use NetInfo Manager, you simply launch it like any other application. If you simply want to view settings, you can dig right in. However, if you want to edit settings, you need to authenticate by clicking the “Click the lock to make changes” button at the bottom of the window. You’ll be asked for your username and password; assuming your user account has admin privileges, entering your username and password will give you temporary Write access to the NetInfo database. (Remember what I said about backing up your database before making any changes.)

I mentioned previously that the NetInfo database is hierarchical in its organization; the NetInfo Manager window reflects this organization. In fact, if you’ve ever viewed Finder windows “by Column,” or used the column view in an Open/Save dialog, the top half of the NetInfo Manager window should look familiar. In Figure 1.7, I’ve navigated to the NetInfo directory for my own user account, frakes. You can see the root level of the database in the left window (/), and all of the directories located at the root level in the middle window. I’ve selected the users directory, which provided me with a list of all users on my Mac. Selecting my username provides me with a list, in the bottom pane, of all the properties associated with my account.

Some of the properties listed should make sense (realname is my “full” name, hint is my password hint—blank because I don’t have one—home is the location of my home folder). On the other hand, others probably don’t mean much to you right now. That’s OK—I’ll talk about some throughout the book; some you may never care about. What’s important is to see how NetInfo Manager lets you view and work with the database.

If you want to edit a value in the lower pane, you simply double-click it (provided you’ve authenticated as described here). The field will become an editable text field, and you can type in the new value. If you really know what you’re doing, you can even add properties, values, and directories. When you’re finished, you simply select Domain Ø Save Changes. Or, if you decide that you want to discard any changes you made, you can instead select Domain Ø Revert to Saved.

At this point, I encourage you to simply click through the various directories in NetInfo Manager to get a feel for how it’s organized and what types of information are stored in the NetInfo database. Unless you’re already familiar with NetInfo, don’t make any changes yet; later in this chapter you’ll get your first taste of actually working with the database.

Note

You’ll notice in Figure 1.7 that there are quite a few users listed. Only five of those users (frakes, guestuser, jennifer, testuser, and trouble) are actually user accounts that I set up in the Accounts panel of System Preferences. The rest are accounts used by the operating system for various tasks and purposes, and are present on all Mac OS X computers. You generally don’t want to make changes to these accounts.

Click To expand
Figure 1.7: User account settings in NetInfo Manager

Backing Up and Restoring the NetInfo Database

Because making changes to your NetInfo database can have such drastic consequences, you never want to make changes without first making a backup of the database itself. In Mac OS X 10.2 and earlier, NetInfo Manager supposedly allowed you to make a backup of your database from within the application (Management Ø Save Backup). However, many users found this method to be problematic; sometimes it worked, sometimes it didn’t. To make matters worse, sometimes you got an error message, sometimes you didn’t—and even if you got a message, the error didn’t necessarily correspond to whether or not the procedure was successful! It would’ve been great if Apple had fixed this bug in the OS X 10.3 version of NetInfo Manager, but they took a different approach—they simply got rid of the command altogether.

So…you basically have to fend for yourself when it comes to backing up your NetInfo database (although, as I explain in the next few sections, OS X will automatically create a backup, if you let it). The steps below show you how to back up your NetInfo database, as well as a couple ways to restore it, if necessary. I also show you how to “rebuild” it from scratch as a last resort.

Backing Up the NetInfo Database
User Level | admin
Affects all | users
Terminal | yes

The easiest, and most reliable, way to back up your NetInfo database is using Terminal:

  1. Launch Terminal (/Applications/Utilities/Terminal).

  2. At the prompt, type the following (all on one line, preserving all spaces as indicated; case is important in Terminal, so make sure you copy case correctly):

    cd /private/var/db/netinfo <RETURN>
sudo cp -R local.nidb local.nidb.backup <RETURN>

  3. When you’re prompted for a password, type your account password (you must be an admin user, of course).

The cp command copies the existing database, local.nidb, to a new set of files in the same directory called local.nidb.backup; since the database is actually a directory of files, the –R option tells cp to copy the directory and all files within it. The sudo command—which asked for your password—provides you with the temporary root access needed to be able to write a new file to that directory. (You’ll learn more about sudo in "Getting to the Root of It," later in this chapter.)

Now you’ve got a backup copy of your NetInfo database. It’s a good idea to use this procedure each time you make changes to NetInfo. In fact, if you’re not the type to back up your computer regularly, it’s also not a bad idea to back up your database after adding, deleting, or modifying user accounts using System Preferences, since such changes are actually editing the NetInfo database. (If you’re not the type to back up regularly, you also need to read Chapter 14, “Mac OS X Maintenance and Administrative Actions,” as soon as possible.) If you’re especially cautious, you can name the backup files differently each time you make changes to the database (local.nidb.backup1, local .nidb.backup2 and so on) so that you have a backup of each generation of changes. (If you don’t back up to a new, differently named copy each time, make sure you delete the previous backup copy first; you can do so using the following command in Terminal: sudo rm -R /var/db/netinfo/ local.nidb.backup.)

Restoring Your NetInfo Database from a Backup: Using Your Own Backup
User Level | admin
Affects | all users
Terminal | yes

If you spend a lot of time working with NetInfo, there’s a chance that at some point you’ll make a mistake, or the database will become corrupt, or, for lack of a better explanation, your NetInfo database will just get screwed up. When this happens, you might see funny things such as home folders not being where they should be, or you may find that you can’t even boot the computer—you never see the login screen. At this point, you’ll be glad you made that backup because the first step you should take in fixing things is to restore your NetInfo database from a reliable copy.

To do this, you need to boot into what’s known as single-user mode. Single-user mode is a limited way of working directly with the file system of your Mac OS X computer without actually logging in as a user. What you see in single-user mode looks a lot like what you’d see in a Terminal window— text on a black screen. The benefit of single-user mode is that in most cases you can use it even if you can’t boot up or log into OS X. (Even if you can log in, you should still use single-user mode to restore your NetInfo database, since the current database is in use when you’re logged in and can’t be replaced). Here are the steps to take:

  1. Reboot or start up your Mac; immediately press and hold command+S. You’ll see a bunch of text scroll by, until you see the following:

    Singleuser boot -- fsck not done
Root device is mounted read-only
If you want to make modifications to files,
run '/sbin/fsck -y' first and then '/sbin/mount -uw /'
localhost#

    (The last line may instead be localhost:/ root#)

  2. If you’re having problems, the first thing you should always do when booting into single-user mode is run fsck, OS X’s built-in disk utility, to make sure your drive is healthy. Type the following at the prompt:

    /sbin/fsck –y <RETURN>

    If you get an error that the file system was modified, run the command again; keep running it until you get a message that everything is OK. (The fsck utility will be discussed in more detail in Chapter 14.) Note that if you get a message that the "Volume is journaled," you should instead use the command /sbin/fsck –yf <RETURN>.

  3. In order to access files on your boot volume, you need to mount the disk. Type the following command (note the space between uw and /):

    /sbin/mount –uw / <RETURN>

  4. Use the mv command to rename the "bad" database from local.nidb to local.nidb.bad:

    cd /var/db/netinfo <RETURN>
mv local.nidb local.nidb.bad <RETURN>

  5. Use the mv command again to rename the backup database local.nidb (all one line):

    mv local.nidb.backup local.nidb <RETURN>

    Note that if you’re restoring from another backup with a different name, you should replace local.nidb.backup with the actual name of your backup database, which you created in the previous exercise.

  6. Restart your computer by typing reboot <RETURN>. This command tells the computer to finish any disk writes that are in progress and then restarts the machine.

When you reboot, OS X will use the newly restored NetInfo database.

Restoring Your NetInfo Database from a Backup: Using the “Daily” Backup in OS X 10.3 and Later
User Level | admin
Affects | all users
Terminal | yes

Although it’s always good to make your own backup of the NetInfo database (as described above), the truth is that OS X may make a daily backup of the database for you. I say may because it only does this if you leave your Mac on and “awake” all night. In Chapter 14, I discuss Mac OS X’s scheduled maintenance scripts. The daily script backs up your current NetInfo database every morning at 3:15. In OS X 10.2 and earlier, this backup isn’t very useful to most users because of its format. However, in OS X 10.3 and later, the format is much easier to work with; the following steps explain how to restore your NetInfo database from this “daily” backup. (Again, remember that this backup is made by the daily script; the backup copy from which you are restoring will be only as recent as the last time you left your Mac on all night. See Chapter 14 for more details.)

  1. In Terminal, follow steps 1 through 4 in the previous exercise (starting up in single-user mode, using the fsck and mount commands, and renaming the "bad" database via the cd and mv commands).

  2. Use the nicl (NetInfo command line utility) command to create a new NetInfo database:

    nicl -raw local.nidb –create <RETURN>

  3. Use the niload command (which loads data into your NetInfo database) to move data from the backup created by the daily script into the new database:

    niload -d -r / -t localhost/local < /var/backups/local.nidump <RETURN>

  4. Restart your computer by typing reboot <RETURN>. This command tells the computer to finish any disk writes that are in progress and then restarts the machine.

When you reboot, OS X will use the newly restored NetInfo database.

The Last Resort: Rebuilding the NetInfo Database
User Level | admin
Affects all | users
Terminal | yes

I hope you never have to use this tip because if you do, it means something has gone horribly wrong with your NetInfo database. However, the truth is that, well, it can happen. Sometimes the NetInfo database gets corrupted so badly that your Mac won’t even start, and either you didn’t make a backup or your backup itself is damaged. In this scenario, your only hope is to wipe out the existing NetInfo database and tell Mac OS X that you want to start from scratch. However, you need to perform just the right set of actions to get the new NetInfo database to work with your previous set of user accounts. Here’s how:

  1. As in the instructions for restoring your database, start up in single-user mode (command+S at startup).

  2. At the localhost# prompt, use fsck to ensure that your drives are in good shape: /sbin/fsck –y <RETURN> (or use /sbin/fsck -yf if you get the "journaled" error). If you receive a message that your file system was modified, run fsck again, as many times as is necessary to get the message that your disk is OK.

  3. To mount the boot disk so that you can access the files on it, type the following (note the space between uw and /):

    /sbin/mount –uw / <RETURN>

  4. Type the following commands:

    cd /var/db/netinfo <RETURN>
mv local.nidb local.nidb.deleted <RETURN>
rm /private/var/db/.AppleSetupDone <RETURN>
reboot <RETURN>

    The second command changes the name of the corrupt NetInfo database to local.nidb.deleted (so that OS X won’t use it when you reboot). You could have deleted it completely using a different command in Terminal, but by renaming it you’ll still have a copy in case it turns out the problem wasn’t a corrupted NetInfo database. The third command deletes a file the operating system uses to keep track of whether or not you ran the initial account setup process. Once you delete that file, Mac OS X thinks that you need to set up your computer (and, therefore, your initial account) again and will launch the Setup Assistant the next time you boot into OS X.

  5. When your computer reboots, the Setup Assistant will ask you to set up a “first” user account. Be sure to provide the exact same short username you used for your original admin account (the one you generally use that has administrator privileges). This will cause Mac OS X to match your “new” account with your existing user folder and all corresponding permissions. Once the computer has finished starting up and you’re logged into your account, you’ll also need to go into the Accounts pane of System Preferences (or the Users pane if you’re using Mac OS X 10.2) and re-create any other users you previously created (see “Creating User Accounts” in the next section). Again, be sure to use the exact short usernames the original accounts used, and to create the accounts in the same order in which you originally created them.

Note

You can find more information (and more advanced information) on recovering and replacing the NetInfo database at http://docs.info.apple.com/article.html?artnum=107210 and http://www.westwind.com/reference/OS-X/NetInfo-recover.html.


Mastering Permissions and Accounts

By now you should have a pretty good handle on the way Mac OS X organizes files, accounts, and permissions. Although much of the book from here on out is oriented toward showing you how to do things, actually doing most of those things, and understanding why and how you’re doing them, will be easier now that you understand this underlying structure. The rest of this chapter will provide some hands-on opportunities as I discuss everything from creating and editing user accounts to using Fast User Switching, from working with the root account to dealing with permissions issues, from creating groups and using group permissions to changing short usernames.

Creating, Editing, and Deleting User Accounts

When you first installed Mac OS X or first booted your Mac, you were asked to provide a name and password; whether you realized it or not, you were actually creating your first user account. That account was automatically given administrative access and, if your first Mac OS X installation was 10.2 (Jaguar) or later, was set to auto-login (meaning you’re not prompted for your name and password at startup). Since that time, you may have continued to use your Mac as the sole user, in which case you may be in the market for some additional user accounts, such as those mentioned in “Other Uses for User Accounts” earlier in this chapter. Or you may have already set up other accounts for family or coworkers, in which case you want to know more about the options available to you (especially since OS X 10.2 and later have provided a number of additional account options over 10.1.x). In the following sections I’ll explain how to create new accounts, edit existing accounts, and delete unwanted accounts. Even if you’ve already created accounts in OS X, you may find some of the details and tips interesting.

Note

The procedures for creating accounts and working with account settings differ between the major versions of Mac OS X. Version 10.2 (Jaguar) added a number of options not available in 10.1 and 10.0, and the way in which account-related settings and preference panes are organized changed significantly between 10.2 and 10.3 (Panther). In the following sections I specifically discuss OS X 10.3 (Panther); see the sidebar “Panther vs. Jaguar: Working with Accounts” for important differences in 10.2 (Jaguar).

Creating User Accounts

User Level | admin
Affects | individual users
Terminal | no

In order to create a new user account in Mac OS X, your own account must have admin access. You create new user accounts using the Accounts panel of System Preferences. First you need to authenticate by clicking the padlock icon at the bottom of the window (next to “Click the lock to make changes”); provide your username and password when prompted.

To add a user, click the plus (+) button below the list of users (just beneath the Login Options button). A new account icon will appear in the list of accounts, and a blank Password panel will appear on the right side of the window.

You’ll also be asked to complete the following fields, as shown in Figure 1.8:

Figure 1.8: Creating a new user account

Name The user’s full name.

Short Name A short version of the user’s name; this will also be the name of their user folder in /Users. Note that in versions of OS X prior to 10.2, the short username was limited to eight characters or less in length, and those characters were limited to a relatively small character set. However, in OS X 10.2 and later, the short username can actually be up to 255 Unicode characters, greatly expanding both the number and the variety of possible characters that you can use (and making the term short username a bit of a misnomer). That said, since you’ll type your short name quite often in OS X (dialog boxes, file paths, etc.), I recommend keeping it a short name, and using characters that are easy to type. I also recommend avoiding punctuation, especially spaces, in short usernames, as they can cause problems.

Password The password you give the new account. If the account is for another person, you’ll need to provide them with this password so that they can change it later to something they prefer.

Verify Enter the password a second time to verify it; if this field and the Password field don’t match, you’ll be asked to type both again until they match.

Password Hint (Optional) You can supply a login window hint for the given password in case the user forgets it (the user can add a hint on their own, or change the one you provide, later). If the user provides the wrong password three consecutive times, they’ll be shown the hint.

Tip

In OS X 10.2, via the Login Options tab of Accounts preferences, you could choose to disable the “Show password hint after 3 attempts to enter a password” option. Although this feature is on by default in OS X 10.3, it’s easy to disable it on an account-by-account basis—simply leave the Password Hint field blank when creating or editing an account. (See Chapter 13 to learn how to disable it system-wide in OS X 10.3.)

Once you’ve filled in the Password tab, clicking any other tab (Picture, Security, or Limitation) or closing Accounts preferences creates the new account. You’ll find that a new folder has been created in /Users, with the new user’s short username as its title. If you log out, the new user (or you) can then log in under the new account. However, you (or the new user) will most likely want to set a few more options for the account.

Click the Picture button to choose a login picture for the account. If you’ve chosen to display the login window as a list of users (via Login Options, discussed in Chapter 3), this is the picture that shows up next to the user’s name in the login window; it's also the picture that is displayed in the list of users in Accounts preferences. You can choose a picture from the list, or you can use your own custom picture by dragging it to the window.

By default, the pictures that appear in the Picture tab of Accounts preferences are located in / Library/User Pictures. If you have other pictures that you like to make available as user pictures, quit System Preferences and drag the images into the User Pictures folder. The next time you open Accounts preferences, the pictures should be available for use.

Tip

You can also assign a picture by clicking the Edit… button. This brings up Panther’s Images dialog—the same one used by iChat to choose your iChat picture. You can click the Recent Pictures pop-up menu at the top of the Images dialog to choose from among the most recently used pictures, or you can click the Choose… button to browse your hard drive for a particular picture. If you have an iSight camera connected, you can even click the Take Video Snapshot button to take a picture of yourself (or any other user) and use it as a login picture! Once you’ve chosen a picture, you can use the slider control to increase or reduce its size and then use the mouse to drag the picture (left, right, up, down) until the desired portion of the image is in the “frame”—the rest will be cropped accordingly.

Once you’ve chosen a picture, click the Security button to choose the appropriate security options for the account. At the top of the Security tab is the setting to enable FileVault protection for the new account. I talk more about FileVault in Chapter 13; please be sure to read that coverage before enabling this option for your account or any other.

At the bottom of the Security tab is the option to “Allow user to administer this computer.” If checked, the new user will have full admin access. Use this option sparingly, and only with people you trust to do the right thing (and not to do the wrong things) with such access. (See the discussion of admin-level accounts in “User Levels,” earlier in this chapter, for more details.)

There’s one last set of options you may want to consider for the new account. If the new user is not an admin user, you can choose to restrict the user’s abilities (administrative user accounts can’t be limited). To do so, click the Limitations tab. The Limitations screen allows you to choose one of three modes for the account:

No Limits With No Limits selected, the account is “standard,” with all of the capabilities that a normal user account has (or doesn’t have).

Some Limits The Some Limits setting does exactly what its name implies: It lets you put some specific limitations on the account (Figure 1.9). You can choose whether the account can open all System Preferences panes or just a limited subset (specifically, all of those in the Personal category plus Keyboard & Mouse, Print & Fax, Sound, .Mac, and Universal Access). You can also choose whether or not the user can modify the Dock, change their account password, and/or burn CDs/

DVDs. In addition, if you select the “This user can only use these applications” option, you can control which applications in /Applications the user can access; which utilities in /Applications/Utilities the user can access; which OS 9 applications in /Applications (OS 9) the user can launch (if that folder is present on your Mac); and any other applications located elsewhere (Others) that the user can launch. You can choose to allow or disallow each category, or you can click the disclosure triangle next to a category to select particular applications within that category. (If you find that some applications aren’t listed, click the Locate… button at the bottom of the window and browse your hard drive to find them. This is also a good way to add applications stored on other partitions or volumes.)

Figure 1.9: Limiting the capabilities of a user
Note

Although limiting user capabilities can be useful, it can also have some side effects. Some applications don’t like being run by a user with limitations on their account. If you use the Limitations feature (or the Simple Finder feature, discussed next), and one or more of your “limited” users is having problems running applications to which they should have access, check with the developer of the application to make sure it’s compatible with Limitations and/or Simple Finder.

Simple Finder This option lets you provide extremely limited access, along with a simple inter- face (for children or users who aren’t very comfortable with computers). The Desktop will be completely empty (it won’t even show the hard drive). The Apple menu will be limited to just three commands: Force Quit (to Force Quit a misbehaving application, as discussed in Chapter 7), Sleep, and Log Out… The Dock will include only the Finder, the Trash icon, and three folders: My Applications, Documents (for saving documents), and Shared (the Shared user folder, for saving or opening shared documents). Clicking one of these folders in the Dock brings up a window in “button” mode—documents and applications are represented by large icons, and a single click opens or launches them. The contents of My Applications are defined by you, the administrator; just as you could limit the applications available to a user in Some Limits mode, selecting applications in Simple Finder mode lets you choose whether or not the user even sees them. Finally, if you choose to allow the user to open System Preferences, only a few of the panels will actually be accessible.

Note

The applications displayed in Simple Finder mode’s My Applications window are actually aliases inside the folder ~/Library/Managed Items/My Applications (inside the home folder of the affected user, not the administrator). When an admin enables an application for the user, OS X automatically places an alias to that application in this folder; likewise, disabling an application will result in the alias for that application being removed.

Editing User Accounts

User Level | normal or admin
Affects | individual users
Terminal | no

Editing user accounts is also done using the Accounts panel of System Preferences. The list on the left side of the window shows existing user accounts, along with the type of each—Admin, Standard (normal), Managed (normal with some limits), or Simplified (normal using the Simple Finder option). To edit an account, you simply select it from the list and then click any of the tabs—Password, Picture, Security, or Limitations—to edit the respective options for that account. However, although this System Preferences panel is available to all users, how much of an account’s settings can be modified depends on user level:

Normal users Assuming an administrator hasn’t limited their capabilities (as previously described), normal users can edit their password, password hint, login picture, and FileVault setting. They can’t change their own limitations, nor can they change their Short Name. (In OS X 10.3.0, although it appears that normal users can’t change their Name—any change appears to be lost when you switch to another tab in Accounts preferences and then back to the Password tab—the change actually “sticks” when you quit System Preferences. It’s unclear at the time of this writing whether this is a bug or a legitimate change from OS X 10.2, which doesn’t allow normal users to change their Name.)

Admin users Users with admin status can edit all settings for other user accounts, as well as every field in their own Password tab, except for Short Name. Note that if another user is currently logged in via Fast User Switching (discussed a bit later in this chapter), user’s account won’t be editable until they log out.

Note

Once you’ve created an account, you can’t change its short name easily. Since the short name isn’t only a login name but also a directory name (the name of the user’s home folder), OS X makes it difficult to change. If you’d like to edit the short name of a user account, see “Why Did I Ever Pick That Name? (Changing Your Short Username)” later in this chapter.

Start Sidebar
Panther vs. Jaguar: Working with Accounts

In OS X 10.2 (Jaguar), the Accounts panel of System Preferences has two tabs: Users and Login Options. (In OS X 10.1 and earlier, Users was a separate preference panel.)

You use the Users tab to create, edit, and delete users. You add a user by clicking the New User… button and filling out the Name, Short Name, Password, and Hint fields. However, you also choose the Picture and “administrator” options on the same screen. You also have the option to “Allow user to log in from Windows,” which is no longer necessary in Panther. Editing and deleting accounts is likewise done by selecting an account and then clicking the Edit User… or Delete User… button, respectively. You also use the Users tab to edit Capabilities (known as Limitations in Panther); the Simple Finder option is included as a check- box here, instead of being a separate Limitations mode as it is in Panther.

The Login tab of Jaguar’s Accounts preferences is where you set Login Items—those items that open at login. These are called Startup Items in Panther, and I discuss them at length in Chapter 3.

Another difference is that Jaguar’s Accounts panel doesn’t have a Security tab, since the File Vault feature is new in Panther and the option to provide an account with administrative access is located in the Users tab in Jaguar.

End Sidebar

Regardless of the user level, two new options appear in the Accounts pane when a user selects their own account. First, in the Password tab, an Edit… button appears next to the text “Address Book Card.” If the user clicks this button, the Address Book application will launch to allow the user to edit their own address card. (This card is used for iChat, Mail, and other Address Book-aware applications.) Second, a tab called Startup Items replaces the Limitations tab. I discuss Startup Items in detail in Chapter 3, but they’re basically applications and documents that you want opened automatically when you log in.

Note

As I’ll discuss in Chapter 13, normally your account password and your Keychain password are the same. In fact, if you change your own account password, your Keychain password is updated to the new password at the same time. However, if an admin user changes the account password for another user, the Keychain password will not be updated. The other user will need to open the Keychain Access application and change it manually.
Start Sidebar
Panther vs. Jaguar: Account Passwords

In Panther, your account password can be extremely long—up to 255 Unicode characters, just like your short username. However, in Jaguar (and earlier versions of OS X), account passwords are limited to eight characters. You can type in a much longer password, but only the first eight characters are recognized. (There are also a few other “techie” differences between the two versions of OS X, in terms of how the system uses account passwords, but the average user won’t really care about them.)

You might think that if you upgraded to Panther from Jaguar, you can use the new Panther password format—and you’d be right, but there’s a catch. If you upgrade to Panther from Jaguar, your password doesn’t take advantage of the new format until you change it. In other words, if you had a 15-character password in Jaguar that was really only being used as an 8-character password, upgrading to Panther doesn’t automatically convert it to the new format. You need to actively change your password using Accounts preferences; once you create a new password under Panther, it uses the Panther password format. (If you like your previous password, just change it to something different and then change it back.)

End Sidebar

Deleting User Accounts

User Level | admin
Affects | individual users
Terminal | no

At some point you may want to delete a user account. Perhaps the user is no longer employed at your company, maybe your friend or relative doesn’t use your computer anymore, or maybe you’ve just been experimenting by creating new accounts as you’ve been reading this chapter and you no longer want them. For whatever the reason, the need sometimes arises to wipe an account off of your computer.

Like creating and editing user accounts, deleting a user account starts in the Accounts pane of System Preferences. However, it doesn’t end there. Since each account has its own home folder replete with settings, documents, and any other files or applications the user placed or saved there, deleting a user account runs the risk of losing anything inside that user’s home folder. Luckily, as you’ll see in a moment, OS X has a mechanism for avoiding this potentially problematic situation.

To delete a user account, first select the user you want to delete in the list of users, and then click the minus (-) button at the bottom of the user list. As soon as you do so, a window will pop up asking if you’re sure this is what you want to do. It also gives you a choice as to what should be done with the contents of the deleted user’s home directory. If you click Delete Immediately, the user account will be removed from your system, and the user’s home directory and its contents will be summarily deleted—meaning you had better be sure you (or the user being deleted) doesn’t need anything in that home directory.

On the other hand, if you click the OK button, the account will be removed, and the contents of the user’s home folder will “be saved in a file in the Deleted Users folder” (Figure 1.10). In the Finder, navigate to the /Users directory; in addition to the home folders of the user accounts that still exist on your computer, there’s now a new folder, Deleted Users. Inside, you’ll find a disk image called DeletedUserName.dmg (it’s not actually called that, of course; DeletedUserName is the name of the user you just deleted). If you double-click the image file, it will be mounted as a volume in the Finder. The mounted volume contains the contents of the deleted user’s home folder, so you, as the administrator, can access any files you or the previous user want to preserve. You can burn them to CD, e-mail them, drop them in another user’s Drop Box, or do whatever you need to do to get them to their rightful owner. Then you can unmount the image and trash the image file itself. At that point, the entire user account is gone forever.

Figure 1.10: Deleting a user account

As a side note, if you’re a neat freak like me, you probably want to get rid of the Deleted Users folder, as well. To do so, you need root access, as the file is technically owned by the system user. In OS X 10.3 (Panther), simply drag the folder to the Trash; you’ll be asked to authenticate to give yourself temporary root access for this particular action. Unfortunately, OS X 10.2 doesn’t have this helpful feature. Instead, launch Terminal and type the following command (make sure you’ve checked the folder to make sure you don’t want anything inside, as this command will permanently delete it and its contents): sudo rm -rf '/Users/Deleted Users' <RETURN>. You’ll be asked for your password; enter it and hit return. The folder is gone for good!

Note

In OS X 10.1.x, deleting a user account doesn’t provide the same nice, neat “disk image” solution; instead, OS X renames the user’s home folder username Deleted, leaves it in the /Users directory, and transfers ownership of the folder to an administrator (you choose which one). The administrator who gains ownership should then go through the Deleted user folder and save or delete the contents as needed. However, you can’t delete the username Deleted folder in the Finder in 10.1.x without root access. Instead, use the following Terminal command to do it: sudo rm -rf '/ Users/username Deleted' <RETURN>, where username Deleted is the name of the folder you want to delete.

Temporarily Disabling User Accounts

User Level | admin
Affects | individual users
Terminal | no

What if, for whatever reason, you want to temporarily disable an account? In other words, what if you don’t want to delete the account, but you want to prevent anyone from being able to log into it, and even prevent it from appearing in the list of accounts in the login window? You can do this in OS X using an old Unix trick in NetInfo Manager:

  1. Open NetInfo Manager, and then authenticate (click the padlock and enter your admin account password). You did back up your NetInfo database, didn’t you?

  2. In the second column of the browser pane of NetInfo Manager (the / level), select users.

  3. In the list of users, select the short username of the account you want to disable.

  4. In the bottom (Property/Value(s)) pane, double-click the Value field for passwd to highlight it for editing.

  5. Replace the existing password value with a single asterisk (*, or shift+8).

  6. Choose Domain Ø Save Changes, and then quit NetInfo Manager.

The account you modified will no longer be available from the login screen (assuming you’ve set the login window to show the list of users). The account will still appear in Accounts preferences, and if you have Fast User Switching enabled, it will appear in the list of users, but no one will be able to log in using that account because it technically doesn’t have a valid password.

In order to reactivate the account, an admin-level user needs to give the account a valid password. Luckily, you don’t need to go back into NetInfo Manager to do this; you can simply use Accounts preferences to change the account password.

Tip

If you want a user to be able to log in, but you simply want to prevent their account from showing up in the login window, don’t change their password to *. Instead, change the value for their account’s uid property to a number less than 500. However, there are two caveats to this approach. First, make sure that you choose a uid that isn’t already in use. Second, if the account in question has been in use for a while, you’ll need to update the permissions on existing files owned by that user so that the user can access them after the uid change. To do this, type the following command in Terminal: sudo find / -user olduid -print0 | xargs -0 sudo chown newuid <RETURN>, where olduid and newuid are the user’s old and new uids, respectively.

Switching Between Accounts Quickly: Fast User Switching

User Level | admin to enable, any to use
Affects | all users
Terminal | no

As I’ve tried to make clear throughout this chapter, the ability to have multiple user accounts on the same Mac provides a good deal of flexibility. However, it also raises an interesting issue that users of OS 9 and earlier didn’t need to face: What if one user of your computer needs access to their account while another is logged in? In OS X 10.2 and earlier, the “solution” was for the user who was currently logged in to close all documents, quit all applications, and log out. The other user would then log in, launch their applications, open their documents, etc. This procedure works fine if the current user is finished with what they’re doing, but what if, for example, you’re using your Mac and your spouse/friend/coworker just needs to quickly check their e-mail, get an address, or print a copy of a document? You have to “close down” your account to let them do their thing, and when they’re done, you have to log back in and deal with getting up and running again. The whole process can be quite a hassle.

To remedy this situation, Apple borrowed a feature from (*gasp*) Windows—but they did it better. If you have administrative access, open the Accounts pane of System Preferences and click the Login Options button. One of the settings on the Login Options screen is “Enable fast user switching.” Turn it on, and the fun begins. When Fast User Switching is enabled, a new menu appears on the right side of the menu bar; the name of the menu is your full account name (technically, the full name of the account currently logged in)—in my case, Dan Frakes. If you access this menu, you’ll see a list of all users on your Mac (Figure 1.11).

Figure 1.11: The Fast User Switching menu

Select another user, and you’ll see a dialog that looks suspiciously like Mac OS X’s login screen. That’s because it is a login screen: Enter the user’s password, and OS X logs into that account, but without logging out of the current account. It even animates the transition using some very cool eye candy— on those Macs with hardware that can handle it, at least—in the form of a rotating cube with the accounts being switched between on different sides. (OK, so it’s not really a cube, since the sides aren’t square, but let’s not spend too much time thinking about that.) This visual effect is one of those things you’ll do a few times, just to watch it. Guaranteed.

As I just mentioned, even though you have just switched out of your account, you haven’t logged out of it—it’s still active, and all of your applications and documents are still open and running. For example, if your e-mail account is set to check for new mail every 15 minutes, it will still do so. If you were burning a DVD, it will keep on burning. When the other user is done using their account, you can switch back to yours and pick up right where you left off. In fact, multiple users can be logged in at once and can switch to their respective accounts at any time without the whole logout/login inconvenience. It’s hard to overstate how much of a time-saver and “hassle remover” this feature is once you’ve used it.

Tip

In addition to providing a hassle-free way to switch between user accounts, Fast User Switching is also valuable as a troubleshooting and testing tool. As I mentioned earlier in this chapter, you can set up additional user accounts for trying out new software and for testing whether a problem you’re experiencing is related to your own account or your computer as a whole. With Fast User Switching enabled, you can quickly access other such account(s) without ever “leaving” your own account.

Keeping Your Own Account Secure When Using Fast User Switching

User Level | any
Affects | all users
Terminal | no

You might be thinking, “But if I have to leave my account logged in, ‘exposed,’ just in case another user wants to switch to their account, what happens to the vaunted account security of OS X?” Apple is one step ahead of you here, and OS X provides a couple of nice Fast User Switching security features. The first is shown at the bottom of the Fast User Switching menu: Login Window… If you select this item, your account will be hidden, and the login window will appear. The effect is similar to what happens when you actually log out of your account but with one big difference: Your account is still logged in, just as if you had used Fast User Switching to switch to another account. In other words, you’re still logged in, but to any other user your Mac looks pretty much like it does when no one is logged in.

The other way to allow other users to switch to their own accounts, without being able to access yours, is to enable OS X’s screen saver with password protection. First, open the Desktop & Screen Saver pane of System Preferences and choose a screen saver. (I discuss screen saver options in detail in the next chapter.) Then switch to the Security pane of System Preferences and enable the “Require password to wake this computer from sleep or screen saver” option. With this setup, if you’re logged into your account and the screen saver is activated, anyone (including you) who tries to deactivate the screen saver will need to provide your account password, or they can click the Switch User… button, which takes them to the standard login screen. From this screen they can log into their own account. Your account is safe and sound.

Tip

When Fast User Switching is enabled, you can tell which users are currently logged in by looking at the Fast User Switching menu—accounts that are logged in have a checkmark next to their names. (The current user’s username is also grayed out to indicate that you can’t select it.) In addition, if you’ve chosen to show the login window as a “List of users,” user accounts that are logged in have the same checkmark and also display the text “Currently logged in” under their names in the login window.

Caveats to Fast User Switching

Although Fast User Switching is one of my favorite features of OS X 10.3 and later, it does have some drawbacks that you should keep in mind. Most of these are related to the fact that applications remain running when you switch out of an account:

Memory and processor usage As I mentioned previously, when Mac OS X switches to another account under Fast User Switching, pretty much everything in the “switched from” account remains active. In other words, having multiple accounts logged in means that more applications are running—including duplicate instances of the Finder and any other applications being used by more than one account—which means that more memory is being used. If a large number of applications, or even just a few applications that are particularly memory-hungry, are running in multiple user accounts at the same time, all users may experience a significant reduction in performance as your Mac resorts to an overdependence on virtual memory and swapfiles (discussed more in Appendix B). To put it in simpler terms, with Fast User Switching enabled, it’s much easier to “run out” of memory. To avoid this situation, make sure multiple users aren’t running memory- intensive applications such as Adobe Photoshop, or, even better, buy some more RAM. It’s pretty cheap nowadays.

On a similar note, if an application in one user account is performing tasks that require heavy-duty use of your Mac’s processor, this can affect performance for other users, especially the active user. So although you may be tempted to start rendering your huge iDVD project just before someone else “takes over” your Mac, be aware that some might find this to be a bit inconsiderate.

Data risks Although Mac OS X is a very stable operating system, the truth is that things do go wrong from time to time. If another user of your Mac manages to crash OS X itself, requiring a restart, keep in mind that such a major crash affects all user accounts. In addition, any admin user can force your Mac to shut down or restart; any unsaved documents in other accounts will be lost. So to be safe, make sure you save any open documents before letting another user switch to their own account (or before leaving your Mac if there’s a chance someone might “switch” while you’re away).

Modem connections Using Mac OS X’s default settings, if one user is connected to the Internet via a dial-up modem connection and then another user switches to their own account, the modem will be disconnected, forcing the “new” user to reconnect. To avoid this situation, open Network preferences and switch to the PPP tab of the Internal Modem configuration; then click the PPP Options… button and, in the resulting dialog, uncheck the “Disconnect when user logs out” option.

Incompatible applications Finally, even though most applications “play nice” with Fast User Switching—each user can launch and use it at the same time—some don’t. Here are a few examples:

Classic environment Only one user at a time can use the Classic environment—OS X’s method for running OS 9 applications, discussed in detail in Chapter 8. If you try to start Classic, or launch a Classic application, when Classic is already running in another account, you’ll see an error that states, “Classic cannot start because it is already running. Classic is being used on this Mac by the user ‘username’.”

iChat If you’re currently logged into AIM or Rendezvous via iChat, when you “switch out” of your account, you’ll be logged out of iChat, as well. The active user will then be able to use iChat in their account. (However, when you “switch back” to your account, the reverse happens—the other user is logged out of iChat, and iChat will automatically log you back in— so this isn’t a completely bad thing.)

iTunes If you’re listening to iTunes and “switch out” of your account, iTunes will stop playing. However, unlike iChat, the other user won’t be able to launch iTunes. Instead, they’ll get an error that reads, “You cannot open the application ‘iTunes’ because another user has it open. Ask the other user to quit the application, then try again.”

Other applications may also be affected; at the time of this writing, I’ve only heard of a few, but I’m sure more will emerge. If you really need to use an uncooperative application that’s running in another account, read on…

Note

One other minor “caveat” to Fast User Switching is that it adds yet another menu to the menu bar—and this one can take up a lot of space, especially if your name is long! If you’d rather have a more svelte Fast User Switching menu, you can change your full name to something shorter, or check out the free SwitchIt (http://www.liquidnexus.com/) or FUS++ (http://fus.sourceforge.net/), both of which replace the text with an icon (a tiny "home" symbol for the former, the user’s login picture for the latter).

Quitting Applications in Other User Accounts
User Level | admin
Affects | other user accounts
Terminal | no

What if you need to use an application, but it’s currently being used in another account and—as described in the previous section—it’s an application that doesn’t support Fast User Switching? If you’re an admin user, you can actually use OS X’s Activity Monitor to quit the application in the other account, using the following steps:

  1. Launch Activity Monitor (located in /Applications/Utilities).

  2. From the Show pop-up menu, select Other User Processes. This will show only applications and processes being run in other user accounts.

  3. In the list of processes, look for the application you want to quit. For example, find iTunes or, in the case of Classic, TruBlueEnvrionme. (You can look at the User column to figure out which user is running the application.) Select the process.

  4. Click the Quit Process button; you’ll get a message that the application (the “process”) is owned by another user, and you’ll need to provide an admin username and password to quit it (Figure 1.12). The dialog will give you two options for quitting the process: Quit and Force Quit. Try the Quit button first. (Provide your username and password when prompted.)

  5. The process should disappear from the list, indicating that it has quit. (If it doesn’t, repeat the process, but click the Force Quit button. This will force the process to quit if it’s being stubborn.) You should then be able to launch the application in your own account.

Warning

If you quit an application running in another user’s account, that user will lose any unsaved work/data in that application. (If you’re quitting the Classic environment, that includes all Classic applications running in Classic.) So before quitting such applications, try to get the user to log in and quit them for you. If that’s not possible, be sure to weigh the importance of you using the affected application with the chance that another user might have unsaved data.

Getting to the Root of It: The Root Account

I mentioned in “User Levels” that in addition to normal user accounts and admin user accounts, there’s a third user level, root. (The root account is also often called the superuser; although there’s technically a difference between the two, for most intents and purposes they’re one and the same.) Although you can have as many normal and admin accounts as you like, you can have only one root account. It exists as soon as you install OS X, and it’s called, quite simply, root. You can’t edit it or delete it; the most you can do is turn it on or off—and only if you have admin access.

Why all the limitations? Quite simply, the root account is too powerful. It’s unhindered by permissions—it can move, edit, delete, copy, trash, view, and open at will. (More accurately, the root account in OS X honors permissions but can change them without restriction, meaning the root account can do as it pleases quite easily.) Although such freedom is helpful at times when you need to do something you don’t normally have the ability to do, it’s also extremely dangerous. The root user can view the contents of all user folders. It can edit, add items to, and remove items from the contents of /System. In fact, it can even (accidentally or on purpose) delete the entire /System directory. Do you really want to have that much power? I sure don’t, and I don’t recommend you do, either, at least not on a regular basis. So although it’s possible to enable and log in as the root user, you definitely don’t want to do so unless you have a specific reason.

In addition, if you do decide to enable the root account, for all the reasons I mentioned previously, you really don’t want to make it easy to log in to the root account. First, anyone who walks up to your computer could log in as root if they discovered your password. Second, even if your Mac is physically secure from unsavory characters, if it’s connected to the Internet and you have any sort of remote access or sharing enabled, anyone in the world with Internet access who discovers your password will have full access to your computer. Needless to say, neither of these situations is good. Have I impressed on you enough why root access is a bad idea? If so, then you’re ready to learn how to use it.

Figure 1.12: Using Activity Monitor to quit an application in another user’s account

There are actually three ways to gain root access. First, you can temporarily gain root access in Terminal from an admin account in order to issue commands as the root user. Second, you can tempo- rarily launch applications as the root user from any admin account. Finally, you can enable the root user account and actually log into your Mac as root. I discuss each of these methods in the sections that follow.

Temporary Root Access in Terminal: sudo

User Level | admin
Affects | n/a
Terminal | yes

If you need to do something in Terminal that requires root access, a command called sudo (short for switch user and do or superuser do), only available to admin-level users, provides temporary root access. Any commands you issue via the sudo command will be free of the restrictions that your user account usually has. You have a couple of ways to use the sudo command.

Running a Single Command Using sudo

By preceding a Terminal command with sudo, you actually run that command with root access. Before the command executes, you’ll be asked for your password to authenticate (enter your personal account password). This is a useful procedure for moving or deleting a file that’s owned by root. If this sounds familiar, it should—I mentioned it earlier as a way to deleted the Deleted Users folder (Figure 1.13). The sudo command actually has a built-in "authentication timer"; once you’ve entered your password, you can continue to issue commands using sudo without needing to provide your password each time. However, once you haven’t used the sudo command for a period of five minutes or so, your authentication period expires, at which point you’ll be back to your old, boring self. The next time you use sudo, you’ll need to provide your password again.

Figure 1.13: Using sudo to execute the rm (remove) command on a protected file
Note

To “refresh” the sudo timer, type sudo -v <RETURN>. This will reset the timer back to zero, giving you another full five minutes to use sudo before you need to re-authenticate. On the other hand, if you’re the paranoid type and you want the sudo timer to expire immediately, type sudo -k <RETURN>.

Running an Entire Terminal Session Using sudo

If you know you’re going to be using a lot of commands that might need root access, you can tell Terminal to maintain your temporary root access until you exit the session. To do this, type sudo –s <RETURN>. You’ll be asked for your password (enter your personal account password). Once you’ve authenticated, you’ll have root access until you end your session (by typing exit <RETURN>, or by closing the current Terminal window). You’ll notice that after issuing the sudo –s command, instead of your normal Terminal prompt, which includes your username, the Terminal prompt will say root# (Figure 1.14).

Figure 1.14: Running a Terminal session as root using sudo -s

Temporarily Running Applications as Root

User Level | admin
Affects | n/a
Terminal | possible, but not necessary

There are times when you’ll want to do something using an application—edit a configuration file in a text editor, move a file or folder using a file utility—that you don’t have the privileges to do from your own account. Because the only way, or the easiest way, to do these tasks is from within an application, you can’t (or don’t want to) use Terminal. You might think that the only way to do this is to enable the root account and then log in as root. Fortunately, OS X provides an alternative: a way to temporarily run individual applications as root. You’ll still be logged in under your personal account, but the application itself will behave as if it’s being run by the root account.

Although it’s possible to do this from Terminal, I much prefer using either Snard (shareware, http://www.gideonsoftworks.com/) or Pseudo (shareware, http://personalpages.tds.net/~brian_hill/), both in my list of "essential" OS X utilities. Snard provides a menu (either in the menu bar or as a popup menu underneath your mouse cursor) that does a number of useful things, one of which is opening an application as root (Figure 1.15). You choose Open As Root… from the menu, navigate to the application you want to use, and then provide your username and password to authenticate as root.

Figure 1.15: Using Snard to launch (left) and authenticate (right) an application as root
Start Sidebar
Sudo Caution (Not Pseudo Caution)

Because you have so much power when using sudo, make sure you type what you mean to type. Word processors can automatically correct typos; Terminal can’t. Terminal interprets commands literally; if you accidentally mistype something and the mistyped command still works, it will be executed. Take, for example, the Terminal command I mentioned earlier:

sudo rm -rf '/Users/Deleted Users' <RETURN>

This command can also be written as:

sudo rm -rf /Users/Deleted\ Users <RETURN>

I’ll talk more about why these commands are the same in Chapter 15, but for now, you’ll have to trust me that the two are the same. Now, suppose you accidentally type this:

sudo rm -rf / Users/Deleted\ Users <RETURN>

Notice the space between / and Users? Terminal notices, and that way of writing the command will erase your hard drive. I’m not kidding.

The moral of the story is this: When using root access in Terminal, don’t mistype. Or use rm –ri instead of rm –rf; the former will ask you to confirm each file it attempts to delete.

End Sidebar

Pseudo, on the other hand, is a one-trick pony, but it does that trick very well. You can open an application as root by dragging it onto the Pseudo icon in the Finder or the Dock. You can also launch Pseudo itself, which provides you with a convenient launch window (Figure 1.16), or you can choose File Ø Launch… from within Pseudo to choose an application. Finally, Pseudo lets you create Launch Documents that open a particular application as root when double-clicked. I have several of these documents for various applications I use frequently as root.

Click To expand
Figure 1.16: Using Pseudo to launch (left) and authenticate (right) an application as root
Note

When you launch an application as root, it uses different preference files, a different Documents folder, a different Desktop folder, etc.—basically a different home directory—than your normal user account. So don’t be surprised if your favorite application settings seem to be gone when you launch that application as root. In addition, if you save a document “to the Desktop” when using an application as root, the default Desktop in that application is the one in the root user’s home directory. To save the file to your own Desktop, navigate to /Users/yourusername/Desktop before saving the file. (See "Logging In as Root," later in this chapter, for more information about the root account’s home directory.)

As an example of when this type of functionality might be useful, some advanced users customize the configuration of the built-in Apache web server in Mac OS X. One of the files used to do this is /private/etc/httpd/httpd.conf. This text file is owned by root, so even an admin user can’t edit it. Yet by launching a text editor, such as OS X’s TextEdit, as root, you can edit and save the file.

As another example, many software installers ask for your admin-level username and password when you launch them. What’s happening is that you’re actually authenticating the installer to allow it to run as root so that it can install files where it needs to install them.

Tip

Although you need the username and password of an administrator to launch an application as root, you can provide that name and password from within any account, normal or admin. For example, if another user with a normal account needs to run a software installer that requires authentication, you can actually type your own admin-level username and password to authenticate it for them, even though you aren’t logged into your own account.

Changing the Appearance of Applications Launched as Root
User Level | admin
Affects | n/a
Terminal | no

Although it’s often helpful to use an application as root, it can also be dangerous for many of the reasons I mentioned previously when discussing the risks of the root account. Normally, if you attempt to edit something you don’t have permission to edit, you’ll get an error stating so; if you’re sure you know what you’re doing, you can then decide to edit that file as root using one of the methods described in this section. I like those error messages, because they serve as a reminder: “Hey, bub, this is a file you probably shouldn’t be messing with.” However, if you’re already running an application as root, you won’t see those errors. In other words, with an application running as root, it’s easy to edit/erase/overwrite system-level files and/or data without warning.

As I mentioned earlier, when an application is launched as root, it uses the root user’s preferences, not your own account preferences. You can use this to your advantage to edit the appearance of applications launched as root, which can serve as a reminder to you that the application is currently all- powerful, and you should be careful. Here’s how:

  1. Launch the System Preferences application as root, using Pseudo or Snard as discussed earlier.

  2. Click the Appearances pane. (If you’re using OS X 10.2, click the General pane.)

  3. Change the Appearance setting to the opposite of your normal setting (for example, if you have your own account set to Blue, choose Graphite).

  4. Change the Highlight Color to something completely different from your own account’s setting.

  5. Quit System Preferences.

From now on, when you launch an application as root, that application will use the root appearance settings you just selected, rather than your own account settings. For example, I use the Blue appearance with yellow highlight color for my normal account, but I use the Graphite appearance with red highlight color for the root account. I can quickly see whether an application was launched normally or as root by looking at the buttons in the upper left of any application window, or by looking at highlighted text. (I would love to show you an example of this, but because the figures in this book are grayscale, the differences wouldn’t be as obvious as they are on-screen.)

Enabling/Disabling the Root Account

User Level | admin
Affects | n/a
Terminal | possible but not necessary

If you can’t do the things you need to do using the methods I’ve already covered, and you’ve read all my dire warnings, and you still want to enable the root account, the following steps explain how. (To be fair, there are a few tips in the book where it’s either necessary, or just plain easier, to use the root account. I just want the seriousness of doing so to sink in.) Like many things in OS X, there are several ways to do it.

Enabling Root Using NetInfo Manager

This is the most common method of enabling the root account, and the one you’ll see most often in tutorials. It’s also the most straightforward:

  1. Back up your NetInfo database (of course!).

  2. Launch NetInfo Manager.

  3. Click the padlock button (or choose Security Ø Authenticate) to authenticate; enter your admin username and password when prompted.

  4. Select Security Ø Enable Root User; if this is the first time you’ve enabled the root user, you’ll be presented with an alert warning you that there is currently no root password.

  5. In the Set Root Password dialog, type a new root password and then retype it to verify it.

  6. The root account is now enabled, but you’ll see a dialog that you must re-authenticate to make additional NetInfo changes.

Enabling Root Using Terminal

You can also enable the root user account via Terminal. Although it’s probably the quickest way, you’re still working in Terminal rather than the graphical user interface (GUI) of NetInfo Manager, which is why many users prefer the previous method.

  1. Launch Terminal (or open a new session window if Terminal is already running).

  2. Type sudo passwd root <RETURN>. This command actually tells Mac OS X to change the password for the root account; in the process, it enables the account.

  3. You may see the following prompt:

    Password:

    You should enter your personal (admin-level) user account password here; this is simply authenticating the sudo command.

  4. You’ll then see another set of prompts:

    Changing password for root.
New password:
Retype new password:

    Here you should type your new root account password and then type it again to verify it.

  5. The root account is now enabled; you could actually go into NetInfo Manager to verify this.

Tip

You can also use this procedure to change the root user password.

Enabling Root Using the Mac OS X Install CD

You can actually use the OS X Install CD’s reset password feature to enable the root user. You’d most likely use this method if your computer is having severe problems that you can only fix by logging in as root. Follow these steps:

  1. Insert the OS X Install CD and start up/restart your Mac while holding down the C key (this forces your computer to boot from the CD).

  2. Once the OS X Installer appears, select Installer Ø Reset Password… to launch the Password Reset utility.

  3. Select the hard drive or volume that hosts the copy of Mac OS X under which you want to enable the root account.

  4. Choose System Administrator (root) from the pop-up menu.

  5. Enter a new root password, and then enter it again to verify it.

  6. Click the Save button. You’ll see a message verifying that the new password has been saved; in the case of the root account, this also enables the account.

  7. Quit the Password Reset utility, and then quit the Installer, which will restart your computer.

Note

If you enabled the root account under OS X 10.2 and then upgraded to OS X 10.3, you’ll probably need to enable the root account again. In my experience, upgrading disables the account.

Disabling the Root Account

If you’re not using the root account on a regular basis, it’s generally a good idea to keep it disabled as a security precaution. If you’ve previously enabled the root account, disabling it is actually very easy. Simply launch NetInfo Manager, authenticate (by clicking the padlock icon), and then choose Security Ø Disable Root User.

Logging In as Root

After you’ve enabled the root account, you’ll probably want to do something really silly like…oh, logging in as root. (Just kidding about the “silly” part. Maybe.) To log in as root, first log out of your current account (or start up the machine if it’s not already booted). At the login screen, depending on your settings in the Login Options screen of Accounts preferences, you’ll see either a list of users or the Name and Password fields. If you see the Name and Password fields, type root as the username and the root password as the password. Alternatively, if your computer is set up to show a list of users, the last user should now say Others… Clicking that button will give you a name/password window that you can use to log in. (If you don’t see the Others… item, press option+return and then click any username; this will provide you with the name/password dialog.)

Tip

You can also use Fast User Switching to switch to the login window and then log in as root.

When you’re logged in as root, your home directory isn’t in /Users, as the home folders of most user accounts are. Instead, it’s located at /var/root (technically a link to /private/var/root). The /var directory is normally invisible in the Finder when logged into non-root accounts, but you can view it from within your own account by choosing Go Ø Go to Folder (or pressing shift+command+G), typing /var, and then clicking the Go button. You won’t be able to work with the folder’s contents—because it’s owned by root—but at least you’ll be able to see its location.

The root user’s home folder contains the usual home directory folders, such as Library, Desktop, and Documents, and the root account stores its preferences and documents in those folders, just like any other user account. In other words, logging in as the root user is just like logging into any other user account—it has its own preference files, its own places to store files, its own Desktop, and so on.

Warning

If you plan on logging in as the root user, I highly recommend that you set up your desktop background and other appearance settings in the root account so that they look very different from your personal user account (such as using a bright red desktop background). This way you’ll have an obvious indicator of when you’re logged in as root (which should serve as a reminder of the unfettered power you have and how much trouble you could cause yourself).

Switching to Root for an Entire Terminal Session

If you’ve enabled the root account, you can actually log into a Terminal session as the root user. (This is similar to using sudo for an entire Terminal session, as discussed earlier in the chapter, except that you’re logging in, via Terminal, as the root user.) To do so, type su <RETURN>. You’ll be asked for a password; instead of your admin-level account password, this is the root account’s password. Once you’ve provided it, you’ll be logged into Terminal as the root user until you end that session (type exit <RETURN> to return to your normal account in Terminal). For most users, this method is identical to using sudo -s as described earlier, except that the root user account itself must be enabled to use su. The main difference in terms of what you can do is a small subset of advanced Terminal commands that can only be executed from the actual root account; if you’ve enabled the root account, logging into Terminal as the root user makes these commands available to you.

Tip

If you ever get confused as to which account you’re logged into inside Terminal, type whoami <RETURN>. Terminal will respond with your current account name (generally username or root).

It’s important to point out that just like logging into OS X as the root user, when you log into a Terminal session as root, your home folder in the current Terminal session is the root account’s home folder, located at /var/root.

I Forgot My Root Password!

So you’ve enabled the root account, but you seem to have forgotten the password. Fortunately (or unfortunately, if you’re security-conscious), Apple has made it relatively easy for an admin-level user to reset the root account’s password. Here are the two easiest ways to do so:

Resetting the Root Password Using sudo In Terminal, type sudo passwd root <RETURN>. If you haven’t used sudo in the last few minutes, you’ll be asked for your password to authenticate.

Once the command runs, you’ll see the following text:

Changing password for root.
New password:
Retype new password:

Type your new root password, and then retype it to verify it.

Resetting the Root Password by Booting from the Install CD Boot from the Mac OS X Install CD. Once the OS X Installer appears, select Installer Ø Reset Password. (This is basically the same procedure described earlier for enabling the root account; instead, you’re just changing the password.)

What Do You Mean I Don’t Have Permission? Working with Permissions

Now that you thoroughly understand permissions, it’s time to actually work with them. In the next few sections I’ll talk a bit about default permissions, changing and setting permissions, and, finally, dealing with permissions problems.

Default Permissions

At this point you know what permissions are, but you may be wondering how a file or folder gets its permissions in the first place. Files and folders created by the OS are given various permissions based on where they’re installed and the purpose of the files and/or the enclosing folder (see “Why Are There So Many Copies of So Many Folders?” earlier in this chapter). However, for files created by users, the answer is much simpler. Files are owned by the user who created them (with Read & Write access), inherit the group of the enclosing folder (with Read-only access), and provide Read-only access to other users.

Creating a file means saving it to disk, whether that’s by saving a new document from within an application, copying a file from another location, or downloading a file from the Web. The act of creating is the key—moving a file from one folder to another retains its original permissions, but copying the same file changes its permissions, as shown in Figure 1.17.

Figure 1.17: A file’s permissions change when it’s copied

The original file was created by jennifer in /Users/jennifer/Documents, and then moved by jennifer to /Users/jennifer/Public. Because I (as an Other user) had access to read the file, I copied it from jennifer’s Public folder to my own Desktop. As you can see, the file’s owner changed when I copied it. (Under OS X 10.3, the group may also change, as I discuss later when I talk about groups.) This change is important because it illustrates that if you don’t want other users to be able to access your files, you need to put those files in a folder others cannot view (Read), or you need to change permissions to give other users No Access.

Note

Non-boot volumes (additional hard drives, separate drive partitions, removable disks, etc.) act, by default, as “shared” volumes. This means that they’re visible and editable by all users, just like the Shared user folder (Read & Write access for everyone). If you want to restrict access to the volume, or to files/folders on the volume, you’ll need to manually change the appropriate permissions.

Changing Permissions

User Level | normal or admin
Affects | certain users
Terminal | no

There are a number of reasons why you might want to change the permissions for a file, for a folder, or even for a volume. Most users will at some point want to open up access to a file or folder so that others can use it, or restrict access to it so that no one else can view or open it. In addition, if you’re an admin user, you’ll inevitably be faced with a situation where you need to open, edit, move, copy, or delete a file or folder, but you can’t because you “don’t have permission.” Admin users often find themselves in this position when they want to delete a file or folder, or when trying to work with files or folders in a location where they’re generally not allowed to do so (in the /System/Library folder, for example).

Thanks to improvements in the Finder under OS X 10.2 and later, there’s no longer a need to use Terminal or third-party utilities to change permissions—you can do it all right from the Finder. Simply click the file or folder and then choose File Ø Get Info (or press command+I). In the resulting Info window, click the disclosure triangle next to Ownership & Permissions to expose the permissions pane. You’ll see the privilege information I talked about earlier in the chapter. What you can do here depends on your user level:

Normal users Normal users can change the access level of all three permissions categories (Owner, Group, Others) for files that they own. However, they can’t change the owner or group to which a file belongs. To change an access level, simply click the Access pop-up menu and choose the desired level of access. The new permissions apply immediately.

Admin users Admin users can also change the access levels of any item of which they’re the owner. However, the difference between normal users and admin users here is that admin users can also change the Owner and Group settings. To modify these additional fields, you first need to click the closed padlock icon to “unlock” it; then simply click the Owner or Group pop-up menu and choose the desired owner or group. (You’ll be asked for your admin-level name and password to make the change—the extra security exists to prevent ill-intentioned passersby from giving themselves access to your entire system if you step away from your computer.) This additional administrative power also means that you can change the access levels for files you don’t own by simply changing the Owner to your own account and then changing the access levels. (You can then change the Owner back to the original user, if desired.)

If you select a folder in the Finder and use the Get Info command, you’ll see one additional option in the Owners & Permissions pane: a button that says “Apply to enclosed items…”. Clicking this button will apply the permissions you’ve set for the folder to all items within that folder. I emphasized the word permissions because OS X does not propagate any changes you made to the owner or group settings. (Also, as mentioned previously, you can only change the settings on files/folders you own; any other items within the folder will retain their current permissions settings.) If you’d like to make such changes to the entire contents of a folder, you’ll need to use Terminal.

Throughout the book, you’ll find lots of places where I mention changing permissions. For example, file sharing, remote access, system security, and Finder troubleshooting are all topics that are privilege-related, and all may require you to use the Get Info window to change permissions. In fact, in just a few pages I’ll talk about groups and group permissions. Suffice it to say that being familiar with permissions, and how to change them, will serve you well, not just for the rest of this book, but in everyday use, as well.

Note

You can use Terminal to change permissions, via the chown, chgrp, and chmod commands. In addition, although it’s no longer necessary to use third-party utilities to change permissions, there are still a number of other file properties that can be easily changed only by using such utilities—I’ll talk more about those topics in Chapter 5.

When Privileges Go Bad: Permissions Problems

User Level | admin
Affects | all users
Terminal | no

A number of situations exist where you’ll find that a system-level file or folder, or multiple files or folders have obtained incorrect permissions. Symptoms of such faulty privileges can include printing problems; problems launching applications (even if they’ve been installed in /Applications); problems connecting to the Internet; an inability to work with a file that you should be able to access; or slow system performance. A couple of specific examples are "type –192" errors when using Disk Copy in OS X 10.2, and "type –108" errors when printing. Some of the causes for these types of problems are software installers that incorrectly change permissions; files being moved, created, or installed while booted into Mac OS 9; disk problems or file corruption; or something as simple as user error (i.e., "Oops, I didn’t mean to change that"). Regardless of the cause, you’ll want to change the permissions to the correct ones to set things right.

For individual files for which you know the correct privileges, the solution is as simple as opening a Get Info window and choosing the correct values (as described in the “Changing Permissions” section). However, at times you’ll find more serious permissions problems: multiple files with incorrect permissions, or system-level files for which you have no idea what the “correct” permissions should be. In these situations, more drastic action is needed. Luckily, Apple has provided solutions for these problems, and, in OS X 10.2 and later, has included the tools both on your Mac OS X Install CD and right on your computer in the form of the Disk Utility application.

To repair permissions while booted into OS X, launch Disk Utility from the Finder (/Applications/ Utilities/Disk Utility) and click the First Aid tab in the main Disk Utility window. Select your Mac OS X volume in the disk/volume panel on the left, and then click the Repair Disk Permissions button in the First Aid panel on the right (Figure 1.18). You may be asked for your admin username and password for the process to proceed. This process will reset all system-level files and Apple-installed software to their original and correct permissions (which will probably take a while, especially on large volumes with lots of files). It will not change the permissions on user-level files. The only caveat to performing the Repair Disk Permissions function is that some third-party software installers (and some Unix software) purposely modify the file privileges of system-level files. If these altered permissions are necessary for the software to work, you may experience problems with that particular software.

Click To expand
Figure 1.18: Using Disk Utility to repair disk permissions

Although Apple—correctly—recommends repairing permissions when booted into OS X, if a permissions problem is preventing your Mac from booting at all, you can also repair permissions from the OS X Install CD. To do so, reboot your computer from the CD (hold down the C key during startup). When the Installer screen appears, choose Installer Ø Disk Utility. Run Repair Disk Permissions, and when it is finished, quit Disk Utility and then quit the Installer; this will restart your Mac. However, if this procedure allows you to start up normally, I recommend repairing permissions again when booted from your normal startup drive to ensure that all system-level files have the correct permissions for your particular system. Repair Disk Permissions uses the receipt files located in /Library/Receipts on the boot volume to determine the correct permissions for system-level files; when booted from the Install CD, it may provide incorrect permissions. This is generally a minor issue, but since you can correct it easily by running the procedure again from the hard drive, why not?

Note

In Mac OS X 10.3 and later, Disk Utility has a Fix OS 9 Permissions function, found in the File menu. If you ever have problems running the Classic environment because of permissions issues, you can use this command to repair the OS 9 System Folder used by Classic so that it has the correct privileges.

Note

In versions of OS X prior to 10.2, Disk Utility did not include the repair permissions option. For these versions of the OS, this functionality is provided via Apple’s Repair Privileges Utility, which must be downloaded. You can find more information about this utility, and download it, from http://docs.info.apple.com/article.html?artnum=106900.

How to Give Permission to More Than One Person (but Not Everyone): Groups

Imagine the following scenario: You have a document that you want you, your spouse, and your eldest child to be able to access and edit. However, you don’t want your younger children to be able to open or edit it. How would you do this? Obviously you’d want to place the file in a location where your spouse and oldest child could get to it, such as your own Public folder or the Shared user folder. However, here’s where the dilemma begins: If you don’t provide access to the file to Others, your spouse and older children can’t access the file. If you open access to Others, they can access it, but so can your younger children. Hmm…you could change ownership of the file to your spouse or your oldest child, but then only one of you would be able to access it, and you’d be in the same boat as before. If only there was a way to provide Read & Write access to you, your spouse, and your oldest child but restrict everyone else to No Access. The good news is that there is a way—groups. The bad news is that Mac OS X doesn’t make groups easy to use. Lucky for you, you bought this book, because I’m going to show you how.

In the discussion of permissions, I explained that every file or folder has three sets of permissions: Owner, Group, and Others. I also mentioned that groups—called such because they’re simply groups of user accounts—are a way to create a subset of users and to give them access that’s different from the access given to Others. If you provide a certain level of file access to a group, each member of that group inherits the group’s permissions. Anyone not in the group (and who isn’t the owner of the file) will maintain the level of access given to Others. Each user can belong to any number of groups, and groups can overlap or be completely independent of each other.

For a non-family example of groups, in a large company you could have groups for the finance department (finance), the IT office (infotech), and the marketing group (marketing). Another group (employees) could contain all the people in all of these groups, whereas a group called executives might contain only the heads of each department. In fact, this concept of groups is exactly how most file servers and large corporate networks keep track of users and user access.

Thus, if we return to the family example, you can create a new group called Adults and include your own user account and that of your spouse and oldest child. You would then give the group Adults Read & Write access to the file in question and restrict Others to No Access. Finally, you would place the document in a location where your spouse and oldest child could access it, such as your Public folder.

Note

Although you can give a group of users access to a file, remember that they must be able to view that file to use it. Thus if you give a group of users Read & Write access to a spreadsheet, but that spreadsheet is located inside your home folder (and isn’t in your Public folder), no one in the group will be able to access the file because your home folder is offlimits. Thus you must place the file in a “public” location such as your Public folder or the Shared user folder. (For more information on the Public and Shared folders, see Chapter 10.)

Unfortunately, as I mentioned, OS X doesn’t make creating groups very easy. In the sections that follow, I’ll explain how to create new groups of users, and then I’ll talk about editing group permissions.

Tip

When you create a new user in OS X 10.3 (Panther), a new group is created with the same name as the short username of the account. This group has only a single member—its namesake user. Although it may seem a bit odd to have a group with only a single member, these “groups” can actually come in handy. Since you can assign both an owner and a group to a file, you can use these single-user groups as a way to give a file two “owners.” For example, in the Adults example I used above, say I only wanted to provide access to myself and my spouse, and prevent access for anyone else. Instead of creating an Adults group—which is how I would have had to do it in OS X 10.2 and earlier—I can assign my spouse’s “group” as the group, give that group the appropriate access, and then restrict Others to No Access. (I say “when you create a new user in OS X 10.3” because if you’ve upgraded to Panther from an earlier version of OS X, existing users won’t belong to these single-user groups; in fact, these single-user groups won’t even exist. Only new accounts created under OS X 10.3 will have them. If you don’t have these single-user groups, you can create them yourself, if you like, using the instructions below.)

Creating a Group

User Level | admin
Affects | members of the group
Terminal | no

Apple’s solution for creating and editing groups in OS X is NetInfo Manager. Although this method isn’t the most intuitive process, it works. You can also create and edit groups using the excellent donationware SharePoints. I’ll explain both methods below.

Creating a Group Using NetInfo Manager

To create a group using the “official” method, we come back to NetInfo Manager. Use the following steps to create a new group called Adults:

  1. Open NetInfo Manager, and then authenticate (click the padlock and enter your admin account password). You did back up your NetInfo database, didn’t you?

  2. In the second column of the browser pane of NetInfo Manager (the / level), click groups.

  3. Although you could create a new group from scratch, it’s much easier to simply copy another group and modify it. In the groups column to the right, select guest, and then click the Duplicate icon in the toolbar (the icon that looks like two folders). You’ll get an alert box asking you if you really want to duplicate the directory. Yes, you really do. (I generally recommend copying the guest group because it’s a safe one to use as a template.)

  4. A new group is created called guest copy. Select this new group.

  5. In the bottom (Property and Value(s)) pane, double-click guest copy in the Value(s) column to edit the name of the group. For this example, you’ll name it Adults.

  6. Double-click the number for gid (gid, also seen as GID, stands for group ID)—since every group must have a unique group ID number, and your new group currently has the same gid as the “guest” group, you need to change the gid to something different from all other gids. You could go through each group, write down each gid, and then choose one that isn’t in use, but since user-created gid numbers are expected to be in the range of 501 to 599, it’s easier just to just start with 551 and work up from there. (You could start lower, but if you or another user—or in Panther, the OS itself—has already created a group or groups, you might stumble over an existing gid).

    1. If you chose to copy a group that has a generateduid property, you need to delete that property from the copy (the new group). To do so, select the generateduid line in the Property and Value(s) panel and click the Delete item in the toolbar.

  7. Next you want to add users to the group. Select the users property on the left, and then choose Directory Ø New Value (Insert Value in Jaguar’s NetInfo Utility). This inserts a new user value called new_value, highlighted for editing. Type in the short username of the user you want to add to the group. You can use the Insert Value command as many times as you need to add all of the users you want to include in this group (Figure 1.19).

    Figure 1.19: Creating a new group, Adults, in NetInfo Manager

  8. When you’ve finished adding users, choose Domain Ø Save Changes to save the changes you made. The group’s name in the groups list will change from guest copy to Adults.

You can repeat this process as many times as you want to create new groups. In addition, you can edit groups (or edit the users in a group) in the same way. To delete a group, you simply select the group name and then click the Delete button in the toolbar (the large icon that looks like a “No Parking” sign). To delete a user from a group, you would simply select the group, select the username in the users property, and then choose Edit Ø Delete.

Note

When you give a user admin access, you’re actually telling the OS to add that user to one or more special groups, including admin and, under OS X 10.2 and earlier, wheel.

Creating a Group Using SharePoints

An easier way to create and edit groups, in my opinion, is to use the excellent donationware Share- Points (http://www.hornware.com/sharepoints/). You can use it either as an application or as a System Preferences pane. In Chapter 2 I’ll talk about installing and using preference panes, but for now I’ll use the application (both the application and the preference pane work the same):

  1. Launch SharePoints, and then authenticate (click the padlock in the lower left and enter your admin account password). Yes, you should still back up your NetInfo database before using SharePoints, since it edits your database.

  2. Click the Groups tab in the SharePoints window.

  3. In the Group text entry field, enter the group name (for our continuing example, type Adults).

  4. In the GID (group ID) field, enter the GID you want to use for this group. Before you do, though, notice the Get Next GID button to the right. Unlike creating a group in NetInfo Manager, where you have to figure out or guess a good group ID number, SharePoints does the work for you—clicking this button automatically enters the next available GID into the field. Go ahead—click it (Figure 1.20).

  5. To create the new group, click the Add New Group button; you’ll be presented with an alert box asking if you’re sure you want to create the new group. Sure you do, so click Yes. (At this point, if you didn’t authenticate when you first launched SharePoints, or if your authentication has timed out, you’ll be asked for your admin username and password.) The new group appears in the group list.

  6. Now that your group exists, you need to add users to it. In the group list on the left, select the new group (Adults, or whatever you used for your new group name). In the Users list on the right, select a user by clicking the username, or select multiple users by clicking multiple usernames while holding down the command key. Then click the large plus (+) button to add the users to the group. The users will appear in the Users in Group column.

  7. To make the changes stick, you must click the Update Group button (previously the Add New Group button). This will save your changes.

Repeat this process to create multiple new groups. You can also edit groups in this same window. To delete a group, select the group and then click the Delete Selected Group button. To simply remove users from a group, select the group on the left, select the usernames to remove on the right, and then click the large minus (–) button to remove them.

Now you’re an expert at users and groups in Mac OS X. Well, almost. Before you can proudly wear your “Users and Groups Xpert” button, you need to learn how to work with group permissions.

Click To expand
Figure 1.20: SharePoints can automatically provide the next available GID for you.

Changing/Setting Group Permissions

User Level | owner of a file/folder, or admin user
Affects | users in the group
Terminal | no

As mentioned earlier in this chapter, whenever you create a new user in OS X 10.3 or later, a new group is also created, named after the user. When that user creates a file, the user becomes the file’s owner, and the user’s “personal” group becomes the file’s group.

In OS X 10.2, new user accounts do not have groups named after them. But this also applies to accounts in 10.3 that were originally created in 10.2 or earlier—for example, if you were previously using OS X 10.2 and then upgraded to 10.3. When one of these users creates a new file, the user is still the file’s owner, but the group is assigned to “staff.”

Which group—staff or username—a file is assigned to is important, as the group setting determines who, besides the owner, can access the file. If you look at the staff group in NetInfo Manager or SharePoints, you see that the members of the group are…well…root. This is a bit misleading because, in reality, every user is a part of the staff group. This means that since the default permissions for the staff group is Read only, if you move a document from your user folder to a publicly accessible folder, anyone can open that document. (What’s more, the default permissions for Others is also Read only.) Since you generally keep private documents in your private home folders, this isn’t too much of a problem; it’s when you move documents to publicly accessible folders that you want to restrict access and, thus, when group permissions become important.

The reason I’m spending so much time here talking about how 10.3-created accounts and 10.2- created accounts differ is because whether or not your documents are assigned to the staff group determines what you have to do if you want to prevent others from accessing the file. With 10.3- created users, you simply have to change the access given to Others. With 10.2-created users, you also have to change either the group or the access given to the assigned group.

Fortunately, with OS X 10.2 and later, changing group ownership and group permissions is an area where Apple has made things much easier than in previous versions of the Mac OS. In fact, the ability to change group ownership and group permissions is built into the Finder itself. However, and I consider this in some ways unfortunate, only an admin user can change group ownership.

Select a document in your home folder (I’ll use SampleDocument.rtf as an example), and choose File ØGet Info. In the Info window, click the disclosure triangle next to Ownership & Permissions to expand the permissions area, and then click the triangle next to Details. Most likely, you’ll see that the Owner is set to your username with Read & Write permissions, the Group is set to your personal group with Read only permissions, and Others also have Read only permissions. (If you’re using OS X 10.2 or earlier, Group will most likely be set to staff instead, but will still have Read only permissions.)

You’ll also see that you can change the Access levels for Owner, Group, and Others by simply selecting the appropriate access level from the pop-up menus, whereas the Owner and Group names appear to be inaccessible. If your account does not have admin access, you can’t change the Owner and Group at all. However, admin users can click the padlock button to unlock these fields.

For example, I can change the Group owner of SampleDocument.rtf from frakes to our new group, Adults (Figure 1.21). When I make the change, I’m asked for my admin username and password; after I enter them, the change is made and SampleDocument.rtf now belongs to the Adults group. (Note that non-admin users can also click the padlock to unlock it, but since they won’t be able to provide an admin username and password, any changes they make will not stick.) I can then provide this group with Read & Write access and change Others to No Access. It’s really that simple. If I now move SampleDocument.rtf into the Shared user folder or my Public folder inside my home folder, only the members of Adults will be able to access it; other users will be able to see that it’s there, but they won’t be able to open it or copy it.

Figure 1.21: Changing the Group owner for a file using the Finder’s Get Info window
Note

In OS X 10.1.5 and earlier, it simply wasn’t possible for a user—even an admin user—to change group ownership or permissions without using Terminal or a third-party utility. For those who are still using OS X 10.1.5 or earlier and want to change group permissions, I recommend one of the excellent shareware utilities BatChmod (http://macchampion.com/arbysoft/), FileXaminer (http://www.gideonsoftworks.com/filexaminer.html), File Buddy (http://www.skytag.com/filebuddy/), or XRay (http://www.brockerhoff.net/xray/). XRay’s interface is the closest to the Finder’s Get Info window, but all of these titles are excellent. I’ll talk about all of them elsewhere in the book.

Unfortunately, there’s currently no way to assign a file to multiple groups in Mac OS X; if you need to give two or more groups of people access to a file (but don’t want to open access to “everyone”), you’ll need to create a new group that includes all of the users from those groups.

Why Did I Ever Pick That Name? (Changing Your Short Username)

I mentioned earlier in this chapter (in “Editing User Accounts”) that although you can easily change your full username, it’s difficult to change your short username once you’ve created an account. This is generally a good thing because it avoids potential problems with things such as folder locations, permissions, and group membership. However, although Mac OS X discourages changing the short username, it’s actually possible (if not easy to do). I suspect that Apple will provide a way to easily change the short username in a future version of Mac OS X, but for now, the following procedures are how you have to do it.

There are actually two ways to change the short username. Any admin user can perform the first method; the second, which is a bit shorter, requires logging in as the root account. (You could also perform this procedure in Terminal, but this is one case where you want to give extra special thanks that NetInfo Manager exists. As messy as the following instructions seem, they’re much nicer than the Terminal commands you’d need to type to get the same result.)

Tip

OK, there is an easy way to change your short username. James Bucanek, the technical editor of Mac OS X Power Tools, helped me create a utility called ChangeShortName that lets an admin user change the short username of any account. It performs all of the steps listed in the manual instructions listed here in the book; in fact, it even backs up your NetInfo database for you and checks for possible problems. Until Apple makes this process available from within Mac OS X, our utility is the only “automated” way to do it. ChangeShortName is available from the book’s website, http://www.macosxpowertools.com/.

Changing the Short Username without Logging In as Root

User Level | admin
Affects | individual user
Terminal | yes

If you don’t have the root user enabled, or you’re uncomfortable logging in as root, this is the way to go:

  1. Open NetInfo Manager, and then authenticate (click the padlock and enter your admin account password). You did back up your NetInfo database, didn’t you?

  2. In the “/” column of the browser pane of NetInfo Manager, select groups.

  3. In the groups column that appears, select wheel.

  4. In the bottom (Property and Value(s)) pane, click the disclosure triangle next to users (this will reveal the user accounts in the wheel group).

  5. If the short username you want to change is listed, double-click it in the Value(s) field; this will make the name editable. Change it to the new short username. (If the username you’re changing isn’t a member of this group, skip this step and move on to Step 6.)

  6. Back in the browser pane, in the same column as groups, select users (if you made any changes to wheel, NetInfo Manager will ask you if you want to save them when you click a different directory—yes, you want to save them).

  7. In the users column that appears to the right, select the name of the user you want to change.

  8. In the bottom (Property and Value(s)) pane, change every instance of the old short username to the new short username. Generally, these are _writers_passwd, name, _writers_picture, and home (change /Users/oldusername to /Users/newusername), but it’s possible to have more, depending on the account. (If realname has the same value as name, it’s because the account uses the same name for both short and long usernames; you don’t have to change the value of real- name,as it’s independent of the short username.)

  9. In the browser pane, again click groups (yes, you want to save the changes you made to the user).

  10. In the list of groups to the right, select admin.

  11. In the bottom (Property and Value(s)) pane, click the disclosure triangle next to users (this will reveal the user accounts in the admin group).

  12. If the short username you want to change is listed here, double-click it in the Value(s) field; change it to the new short username. (If the username you’re changing isn’t a member of this group, simply move on to Step 13.)

  13. If you’ve created any other groups that include this user account, you’ll also want to change the short username in those groups as you did with the wheel and admin groups. If you’re using Mac OS X 10.3 (Panther) and you created the account being changed after installing Panther, there will also be a group with the same name as the short username, as discussed earlier in this chapter. You should change the name of that group to the new short username.

  14. Choose Domain Ø Save Changes; quit NetInfo Manager.

  15. Open Terminal, and type the following command:

    sudo mv /Users/oldshortusername /Users/
newshortusername <RETURN>

    You’ll be asked for your password to execute the command. This changes the name of the appropriate user folder (in /Users) from the old short name to the new short name.

  16. Still in Terminal, type the following command:

    sudo -s <RETURN>
cd /Users/newshortusername
/Library/Keychains <RETURN>
mv oldusername newusername <RETURN>

exit <RETURN>

    This command renames the user’s keychain so that it works properly with the new username.

  17. If the user whose short username is being changed is allowed to connect via Windows File Sharing, you’ll need to change the name of their Samba password hash file:

    sudo -s <RETURN>
cd /var/db/samba/hash <RETURN>
mv oldusername newusername <RETURN>

exit <RETURN>

  18. If you ever use OS X’s Web Sharing, type the following command in Terminal (if you don’t use Web Sharing, skip to Step 20):

    cd /etc/httpd/users <RETURN>
sudo mv oldshortusername.conf
newshortusername.conf
<RETURN>

    This updates the Web Sharing configuration for the user account.

  19. If you use Web Sharing, open the file you just renamed (/etc/httpd/users/ newshortusername) and change this line:

    Directory "/Users/oldusername/Sites/"

    to the following:

    Directory "/Users/newusername/Sites/"

    (Because the file is owned by root, in order to edit it you’ll need to use a text editor as root, as described earlier in this chapter.) This change tells the Mac OS X Web server where the user’s Web documents folder is located; if the user is actually using a different location for their personal Web server documents (you’ll most likely know if they are), then edit this line accordingly.

  20. The short username of the account should now be changed. Phew! If you’re actually logged in as that user, you should immediately log out and back in again.

Changing the Short Username by Logging In as Root

User Level | root
Affects | individual user
Terminal | no

If you’ve enabled the root user, you can log out, then log back in as root, and use the following procedure. It’s a bit quicker, doesn’t require Terminal, and does exactly the same thing as the previous set of instructions:

  1. Open NetInfo Manager, and then authenticate (click the padlock and enter your root account password). You did back up your NetInfo database, didn’t you?

  2. In the “/” column of the browser pane of NetInfo Manager, select groups.

  3. In the groups column that appears, select admin.

  4. In the bottom (Property and Value(s)) pane, click the disclosure triangle next to users (this will reveal the user accounts in the admin group).

  5. If the short username you want to change is listed, double-click it in the Value(s) field; change it to the new short username. (If the username you’re changing isn’t in this group, skip to Step 9.)

  6. Back in the browser pane, in the same column as admin, select the wheel group (yes, you want to save the changes you just made to the admin group—NetInfo Manager will ask you when you click a different group).

  7. In the Property and Value(s) pane, click the disclosure triangle next to users (this will reveal the user accounts in the wheel group).

  8. In the Value(s) column, click the short username you want to change; change it to the new short username.

  9. If you’ve created any other groups that include this user account, you’ll also want to change the short username in those groups as you did with the wheel and admin groups. If you’re using Mac OS X 10.3 (Panther) and you created the account being changed after installing Panther, there will also be a group with the same name as the short username, as discussed earlier in this chapter. You should change the name of that group to the new short username.

  10. Back in the browser window, in the same column as groups, select users (yes, you want to save your changes).

  11. In the new users column to the right, select the name of the user you want to change.

  12. In the Property and Values pane, change every instance of the old short username to the new short username. Generally, these are _writers_passwd, name, _writers_picture, and home (change /Users/oldusername to /Users/newusername), but it’s possible to have more, depending on the account. (If realname has the same value as name, it’s because the account uses the same name for both short and long usernames; you don’t have to change the value of realname as it’s independent of the short username.)

  13. Choose Domain Ø Save Changes; quit NetInfo Manager.

  14. In the Finder, go to the /Users directory. Change the name of the appropriate user folder from oldshortusername to newshortusername.

  15. In the Finder, go to the /Users/newshortusername/Library/Keychains folder. Change the name of the Keychain document from oldshortusername to newshortusername. This renames the user’s Keychain so that it works properly with the new username.

  16. If the user whose short username is being changed is allowed to connect via Windows File Sharing, you’ll need to change the name of their Samba password hash file. Go to /var/db/ samba/hash in the Finder, and change the name of the appropriate document from oldshortusername to newshortusername.

  17. If your computer ever uses OS X’s Web Sharing, go to the /etc/httpd/users directory in the Finder. Change the name of the appropriate document from oldshortusername.conf to newshortusername.conf. This changes the Web Sharing configuration for that user account. (If you don’t use Web Sharing, skip to Step 19).

  18. Open the file you just renamed (/etc/httpd/users/newshortusername), and change this line:

    Directory "/Users/oldusername/Sites/"

    to the following:

    Directory "/Users/newusername/Sites/"

    This tells the web server where the user’s Web documents folder is located. If the user is using a different location for their Web server documents, edit this line accordingly.

  19. The short username of the account should now be changed. Log out of root. Log back in using your own account.

Apple has actually posted a set of instructions for changing the short username of an account. However, I’m not a fan of Apple’s instructions for a few reasons:

  • They require you to log in as root; there’s no option to follow their instructions without enabling the root account.

  • Rather than actually changing a user’s short username, Apple’s procedure has you create a new user, transfer everything from the old user’s account to the new user’s account, and then delete the old user. I find this to be messier than simply changing a user’s actual short username.

  • Apple’s instructions don’t take into account any group memberships the user may have that need to be updated, nor do they take into account any files or folders throughout the OS, but not in the user’s home directory, that may be owned by the user—which is important if the user is an admin.

All that said, if you’d like to use, or just peruse, Apple’s own instructions, visit http://docs.info.apple.com/article.html?artnum=106824.

Creating a No-Password Account

User Level | normal or admin
Affects | individual user
Terminal | no

If you’re the only user of your machine—or you don’t have any reason to keep others out of your account—you may find it convenient to not have an account password. Anytime you’re asked for your password, you can simply press the return key rather than having to type in a password. This can be especially convenient if you’re an admin user, since you’ll be asked for your password whenever you make system-level changes, and many times when you install software.

However, before I explain how to do this, I want to include a serious caveat: If your account is an admin-level account and either you’re not the only user or you’re running any remote services (as described in Chapters 10 and 11), you should always have a password. An admin account without a password is the worst security risk possible. Anyone who walks up to your computer or connects to it over a network or the Internet can do pretty much anything they want, including enabling the root account and changing your personal account password so that you can no longer log in.

Note

If you’re the only user of your machine, unless you’ve created an extra non-admin account, your account will have admin access.

To remove the password from your account, you use the Accounts pane. Select your user account from the list of users, and then click the Password tab on the right. (If you’re using Jaguar, click the Edit User… button.) Enter your current password, but then leave the New Password and Verify fields blank. When you click another tab or try to leave the Accounts preference pane (or, in Jaguar, when you click OK), you’ll get a dialog warning you about not setting a password (Figure 1.22); click OK (Ignore in Jaguar) to continue. Your account now has no password, and you can simply press the return key, or click the OK button, whenever you’re prompted for a password.

Figure 1.22: OS X warns you if your account doesn’t have a password.
Note

Some Mac OS X updates require a non-blank password; if you’ve set your password to be blank and you want to install a system update, you should first change your password to a non-blank one using Accounts preferences. After the install is complete you can change your password back to its previous (blank) state.


Moving On...

Team LiB

Moving On…

I hope that at this point you thoroughly understand the concepts of users, groups, file permissions, and Mac OS X’s file organization. Although these may not be the most exciting topics, they provide the basis for nearly everything else you’ll do in the rest of the book. Having a good handle on these issues means you’re ready to start getting into the fun stuff. We’ll start with setup and preferences.


Chapter 2: Sensational Setup

(Or: Making your Mac work the way you want.)

If you’ve been using Mac OS X for a while now, you’ve probably used the System Preferences application to customize some of your OS X preferences. You’ve probably also changed a few settings in applications, and maybe even in the Finder. Even if you just started using Mac OS X, you had to set up a few things when you first started your Mac (remember the Setup Assistant?). However, chances are there are still many settings you don’t know exist, a few you don’t quite understand, and ways of setting them up you’ve never even thought of. Understanding, and taking advantage of, these settings is the purpose of this chapter.

System Preferences: Beyond the Basics

Most of the ways you can customize Mac OS X’s built-in features can be found in the System Preferences application (/Applications/System Preferences), easily accessible from the Apple Menu (Apple Menu Ø System Preferences…). Whereas in Mac OS 9 you had a folder full of individual control panels, System Preferences provides you with access to a smorgasbord of settings in a single window (Figure 2.1).

Figure 2.1: The System Preferences application

Each icon and name represents a topic-specific collection of settings that you can customize; if you click an icon, the System Preferences window will change to present that group of settings to you for editing. For example, click the Dock icon, and System Preferences will present you with system settings that relate to the appearance and functionality of the Dock. Each of these topical collections of preferences is called a preference panel or preference pane (the two terms are used interchangeably).

Tip

Hold the shift key down as you click an icon in System Preferences to see this transition in super slow-mo. This trick also works when you click the Show All button to see all preferences panes at once.

Although many settings throughout System Preferences are self-explanatory, many others are not; in addition, some options are less than obvious—unless you know to look for them, you might never even know they exist! For this reason, I’ll spend a good deal of this chapter covering the System Preferences application, the various panels within System Preferences, and how to best take advantage of the options these panels provide. Although any user can access any pane, some preferences are modifiable only by admin users; when I discuss each pane, I note the access level required to change its settings. I’ll also include ways to expand on the options Mac OS X provides.

In addition, I’ll talk about how to add preference panes to System Preferences, how to change preferences that aren’t contained in System Preferences, and how to find and edit preference files directly.

The System Preferences Application

As I already mentioned, System Preferences is actually an application. When you launch it (either by selecting System Preferences… from the Apple Menu, by clicking the System Preferences icon in the Dock, or by manually launching it from your /Applications folder), it appears in the Dock just like any other application. It then provides you with groups of related preference settings, each represented by icon and name (e.g., Desktop & Screen Saver, Displays, Keyboard & Mouse, Sound). However, as an application, it also provides you with its own options.

View Alphabetically or by Category

By default, the various preference panes are arranged in categories that indicate the type of settings they modify: Personal, Hardware, Internet & Network, System, and—if you’ve installed third-party preference panes, as described later in this chapter—Other. (I’ll talk about each of these categories, and the individual preference panels within them, in a bit.) Although these categories can be helpful for some users, others are accustomed to looking for things alphabetically. Luckily, System Preferences provides that option, as well: select View Ø Show All Alphabetically, and the categories disap- pear; the panes are then listed in alphabetical order.

Access Preference Panels Directly

If you’d rather not deal with icons at all, you can select any preference pane from an alphabetical list by choosing the appropriate panel name from the View menu; System Preferences immediately changes to the appropriate pane. This is also a helpful tip to use when switching between preference panes. Rather than having to click the Show All icon, and then choose another pane, you can simply choose the pane you wish to switch to and skip the middle step.

Tip

Under OS X 10.3 and later, when the main (Show All) window is displayed, you can also access preference panes using the keyboard. Simply type the first few letters of the name of the desired panel; its icon will display a subtle blue or gray highlight to indicate that it’s been selected. (The color of the highlight depends on your Appearance setting in the Appearance pane.) Press the space bar to switch to the highlighted pane. To switch back to the Show All view, press command+L. (Once a pane is highlighted, you can also use the arrow keys to move between panes.)

Pick Your Favorites and Customize the Toolbar

As you read this book, you’ll find that most applications written in Mac OS X’s native Cocoa language—and some Carbon applications, as well—allow you to customize the toolbar—the area at the top of an application’s window. System Preferences is no exception; you can choose your favorite preference panes, and you can change how the toolbar is displayed. (I cover toolbar customization in more depth later in this chapter under “Application Preferences.” I discuss types of OS X applications—Cocoa, Carbon, and Classic—in Chapter 7.)

Pick Your Preferred Panes

You’ll notice that a few preference pane icons appear in the area to the right of the Show All icon. This area (the toolbar) in System Preferences is intended to be a place for you to put your most frequently used preference panes for easy access. To add a pane, simply click its icon in the main window and drag the icon to the toolbar; it will be added wherever you drop it. If you drag the icon between two existing icons, they’ll spread apart to accommodate the new one (Figure 2.2).

Figure 2.2: Adding a preference pane to the toolbar

You can also rearrange your favorites in the toolbar by dragging them left and right; again, the other icons will move apart to let you place each icon where you want it.

If you decide you no longer want a particular pane in the toolbar (or you want to remove one of the default items that was there from the beginning), simply drag its icon from the toolbar down into the main window area. You’ll see an animated puff of smoke to indicate that it has been removed from the toolbar (it will still be available from the main Show All window, of course).

Customize the Toolbar’s Appearance

Here’s one of those hidden features I was talking about. In the upper right of the System Preferences window is a clear, capsule-shaped button (often called the toolbar widget). You may have clicked this button and discovered that it collapses the toolbar so that only the main list of preference panes is visible. However, it does more that just that. Command-click the button, and you’ll find that it cycles through various toolbar views: large icons and text, small icons and text, large icons only, small icons only, large text only, and small text only. This is a very handy feature if you tend to put a lot of your favorite panes in the toolbar since you can make the icons and/or text smaller.

Other Ways to Access Preference Panes

One major difference between changing system-level preferences in Mac OS X and changing them in Mac OS 9 is that in OS 9 you could go to the Apple Menu and select the appropriate control panel directly; in OS X, you have to first open System Preferences and then choose the set of preferences you want to modify. Fortunately, enterprising software developers have provided solutions for this minor inconvenience. In addition, you can even create your own solution with a bit of work.

Access from the Apple Menu
User Level | admin to install, normal to modify
Affects | computer or individual user, depending on installation
Terminal | no

Users who have moved to OS X from OS 9 probably find themselves looking for control panels in the Apple Menu out of habit, sometimes even after weeks or months of use. Apple has provided quick access to the System Preferences application in the Apple Menu but, unfortunately, didn’t provide the convenient submenu of settings panes you might expect. You can easily remedy this oversight with the excellent shareware FruitMenu (http://www.unsanity.com/), which provides you with a System Preferences submenu just like OS 9’s Control Panels submenu. FruitMenu actually does much more than this, and I’ll talk about it in several other places in this book.

Access from the Menu Bar
User Level | normal
Affects | individual user
Terminal | no

In addition to accessing individual preference panes from the Apple Menu, it’s also possible to access them from a separate menu in the menu bar. My favorite utility for this is the shareware Menuprefs (http://www.ithinksw.com/products/menuprefs/), which provides an elegant and configurable preference pane menu (Figure 2.3). You can choose to have preference panes listed in the menu by name, category, location (system, local, or user Library folder), or a custom order that you create in Menuprefs’ own settings dialog.

Figure 2.3: Menuprefs provides a menu of preference panes right in the menu bar.
Access from the Dock
User Level | any
Affects | individual users
Terminal | no

Although there used to be a number of utilities, called Docklings, that provided a System Preferences menu from the Dock, most of them no longer work—Apple discontinued support for Docklings as of OS X 10.2. However, it’s still possible to get such a menu from the Dock, even if the implementation is a bit less elegant.

Note

In OS X 10.3 and later, if System Preferences is running and you control/right-click its icon in the Dock, you’ll get a menu with a list of all preference panes; unfortunately, this trick doesn’t work if System Preferences isn’t.

  1. In the Finder, create a new folder (by choosing File Ø New Folder or pressing shift+command+N) inside your user folder, and call it System Prefs.

  2. Open the /System/Library/PreferencePanes folder.

  3. Select all of the files inside the folder (they should all end in .prefPane).

  4. Hold down command+option, and then drag the selected files into your newly created System Prefs folder. This will create aliases for each of these files in the System Prefs folder.

  5. Select the new System Prefs folder and drag it to the right side of the Dock.

The folder is now part of the Dock; if you click and hold on the folder in the Dock, or control/ right-click it, you’ll get a menu of the contents of the folder, which just so happens to be all of your preference panes. Select one from the menu, and System Preferences will immediately open to that pane.

I’ll talk more about preference pane files like these at various places in this chapter. In addition, if you’ve installed any custom preference panes (also discussed later in this chapter), you’ll need to add their aliases to your new System Prefs folder, as well. But I’m getting ahead of myself. For now, this is just an example of the kinds of customization you can do in Mac OS X with a little understanding of how things work and a bit of creativity.

Note

Now that I’ve shown you the manual method to do this, I’ll tell you that you don’t need to do it that way— instead you can download the freeware Dockprefs (http://ksuther.dyndns.org/software/dockprefs/index.html). For more on Dockprefs and Dock customization, see Chapter 6.

Preference Pane Security

As you work with various preference panes, you’ll see that some of them have an authentication (pad- lock) icon in the lower left. This generally means that the settings in a particular pane are system-level settings and that you can “lock” that pane so that it requires an admin username and password before changes can be made.

You actually have two ways to take advantage of this security setting. The first is to manually “lock up” each secure preference pane after you’re done with it. Once you, as an admin user, lock a pane, anyone who wants to make changes in that pane (including you, the next time you open it) will need to provide an admin-level username and password. However, this method requires that you remember to lock each pane when you’re done with it. As an alternative, if you open the Security pane of System Preferences and enable the “Require password to unlock each secure system preference” option, whenever you close a secure preference pane (by switching to another panel or by quitting System Preferences), it will be locked automatically. This is a good option to use if your computer is in a public location where there’s a chance you might walk away from it while still logged in.

Note

In addition to the standard preference pane security described here, you can also limit an individual user’s level of access to System Preferences via the Limitations tab of Accounts preferences (as described in Chapter 1). If you disable the “Open all System Preferences” option for a particular user, many System Preferences panes will be off-limits to that user.

Problems Opening System Preferences?

You may eventually encounter a situation where the System Preferences application doesn’t behave properly—the application refuses to launch; it crashes when you launch it; it launches but some preference panes don’t appear, or some appear more than once; or the application just behaves oddly. One of the most common reasons for this sort of behavior is a corrupt System Preferences cache file or preference file. If you find yourself having such problems, quit System Preferences, and then delete the following two files:

  • ~/Library/Caches/com.apple.preferencepanes.cache

  • ~/Library/Preferences/com.apple.systempreferences.plist

There’s a good chance that the next time you launch System Preferences the problem will be gone.

Now it’s time to talk about the preference panes themselves. I’ve divided them into categories to mirror the default display of System Preferences (on an English-language system, to be perfectly accurate; on non-English systems they’re arranged differently).

The Personal Category in System Preferences

Apple calls this category of preference panes personal because they include preferences that affect only your personal account. I find this name a bit misleading, however, because it implies that changes made in the panes not included in this category affect more than just your account; in fact, many of them don’t. Nevertheless, most of those included here do seem to be personal in their nature.

Appearance

User Level | any
Affects | individual user
Terminal | no

The Appearance pane of System Preferences (called General under OS X 10.2 and earlier) is a bit of a hodgepodge of settings that don’t seem to fit anywhere else; some have absolutely nothing to do with the “appearance” of anything. Most of these settings are fairly self-explanatory: the colors of buttons and menus, the color for highlighted text, the behavior and look of scroll bars. However, a few deserve a quick mention, and you can actually modify a couple others to a greater extent than Apple would have you believe.

“Click in the scroll bar to”

This setting determines what happens when you click in the empty area of a scroll bar for a document or window that’s too large to fit in the current window. The “Jump to the next page” setting means that you’ll simply scroll a page at a time. The “Scroll to here” setting, on the other hand, figures out where, in the overall context of the document, your click would be. In other words, if you were to click exactly in the middle of the scroll bar, the document would be scrolled to its midpoint; if you clicked exactly one-fourth of the way from the bottom of the scroll bar, the document would be scrolled to the three-fourths mark.

Tip

Whichever option you choose for the “Click in the scroll bar to” setting, you can temporarily use the opposite setting by holding the option key down as you click in a scroll bar.

“Use Smooth Scrolling”

Smooth scrolling is a bit hard to describe. First, it only affects Cocoa and certain Carbon applications. Second, it comes into play only when you use the page up/down keys, or when you click or click-hold inside the empty area of scroll bars (which normally causes the document to scroll a page at a time). When smooth scrolling is active, instead of jumping a screen at a time, the document will, well, scroll more smoothly (mainly by accelerating and decelerating smoothly instead of simply skipping pages completely).

Tip

If you have smooth scrolling enabled and want to temporarily scroll normally, hold the shift key down (or enable caps lock); this will disable smooth scrolling until you release the shift key (or disable caps lock).

“Number of Recent Items”

The settings for Number of Recent Items actually refer to the Recent Items submenu in the Apple Menu. The numbers here are the settings for how many recently used applications and documents, respectively, show up. You can clear the menu of its current listings by choosing Apple Menu Ø Recent Items Ø Clear Menu.

Get Better Scroll Arrows

In the Appearance preference pane, you’re given two options for scroll bar arrows. One option is “At top and bottom,” which really means one on each end (up arrow at the top of a vertical bar, down arrow at the bottom, left arrow on the left side of a horizontal bar, right arrow on the right). The other option is Together, which actually means up/down arrows together and left/right arrows together, with both sets grouped in the bottom-right corner of each window.

I don’t know about you, but I prefer to have a combination of the two—left/right grouped together on both the left and the right, and up/down grouped together at both the top and the bottom! In fact, this layout is actually an option in the Mac OS, but you don’t have any way to access it—or do you?

Actually, you do, and this will be my first mention of one of the best utilities available for OS X, the freeware TinkerTool (http://www.bresink.com/osx/TinkerTool.html). What makes Tinker- Tool unique is that it really doesn’t do anything other than allow you to access existing options, preferences, and features of Mac OS X that, for whatever reason—most likely a fear of confusing new users—Apple has decided to hide. Using TinkerTool, you can choose to have scroll arrows "Together at both ends" (Figure 2.4).

Figure 2.4: Using TinkerTool to improve your scroll bar arrows

As you read through this book, you’ll find that I mention TinkerTool many times.

Better Font Smoothing

One of the reasons Mac OS X’s Aqua interface looks so beautiful is that most text is anti-aliased, which means that rough edges are smoothed out. However, since not all monitors (or eyes) are created equal, what looks smooth to one person might look blurry to another. In addition, the smaller the font, the more difficult it is to read if it’s smoothed too much—and the point at which “smooth” becomes “blurry” differs from person to person. The font smoothing area of Appearance preferences lets you decide how much smoothing of fonts you want OS X to do (“Font smoothing style”) and at what size text you want it to stop smoothing altogether.

Beginning with OS X 10.2, Apple has made the setting for smoothing style more convenient by including examples: Standard is recommended for CRT monitors, and Medium is best for flat- panel (LCD) displays. However, you may not want to take Apple’s recommendation as law—I find that I prefer the Standard setting for my flat-panel displays. You should test the different levels of smoothing on your own system until you find the best one for you. Likewise, change the font size setting until you find the one that makes larger text smooth while maintaining the readability of smaller text.

Tip

Font smoothing actually requires a good chunk of processing power. If you have an older Mac, you may find that it feels faster if you turn off font smoothing for as many sizes as possible (by choosing the largest value in the “Turn off text smoothing” pop-up menu).

If you use a number of older Mac OS applications that use QuickDraw instead of OS X’s Quartz Extreme, TinkerTool (mentioned above) provides additional options for font smoothing within QuickDraw applications. It also lets you choose different system fonts than the Mac OS X defaults.

Desktop & Screen Saver

User Level | any
Affects | individual user
Terminal | no

The Desktop & Screen Saver pane provides you with the ability to change the background of your Desktop—on each screen, individually, if you have more than one display connected—and to choose a screen saver for those times when your Mac is unattended. Because the functionality of each is independent from the other’s, I’ll talk about the Desktop tab and the Screen Saver tab separately.

Start Sidebar
Panther vs. Jaguar: Panther vs. Jaguar: System Preference Panes

As I mentioned in the Introduction of this book, and as you’ll see in a number of sidebars like this throughout the book, with every major update to Mac OS X, Apple changes the options available to users, and even the places various options are located. The panes of System Preferences are prime examples of this phenomenon. Some panels that exist in OS X 10.2 no longer exist in OS X 10.3, and others have been integrated into new or combined panels. If you’re coming to OS X 10.3 from 10.2, here’s a quick summary of major preference pane changes between the two versions:

Mac OS X 10.2 Preference Pane | Location of Settings in Mac OS X 10.3
ColorSync | The Preferences screen of ColorSync Utility
 | (/Applications/Utilities/ColorSync Utility)
Desktop | Desktop & Screen Saver pane
General | Appearance pane
Internet | .Mac pane; some settings no longer available (see Chapter 9)
Keyboard | Keyboard & Mouse pane
Login Items | Startup Items tab of Accounts pane (see Chapter 3)
Mouse | Keyboard & Mouse pane
My Account | Password and Picture tabs of Accounts pane
Screen Effects | Desktop & Screen Saver pane
End Sidebar
The Desktop Tab

Mac OS X supports a number of image formats for use as desktop pictures/backgrounds: JPEG, GIF, TIFF, PICT, and even PDF files. You choose a desktop background using the Desktop tab of Desktop & Screen Saver preferences.

When you click the Desktop tab, a new window will appear for each connected display. (Of course, if you have only one monitor/display, you’ll see only one window.) To select a desktop background for a display, you simply select a folder of images from the list of Collections on the left, and then click one of the pictures in the preview list to the right to change your Desktop to that image. You can choose one of the folders of images Apple has provided, your own ~/Pictures folder, or any other folder of images on your hard drive by selecting Choose Folder… (Note that if you select a custom folder, only photos at the top level of that folder will be available for use as desktop pictures.) Under OS X 10.3 and later, you can even choose your iPhoto Library or any album you’ve created in iPhoto; these will be listed at the bottom of the list of the Collections.

Tip

To quickly access the Desktop tab of Desktop & Screen Saver preferences, control/right-click anywhere on the Desktop and choose Change Desktop Background… from the resulting contextual menu.

By clicking the “Change picture” box, you can choose to have your desktop picture changed automatically every login, every time your computer wakes from sleep, or at predefined time intervals. The pictures will be chosen from the selected Collection, and, if you prefer, can be selected randomly, instead of in order, by checking the “Random order” box. If you have multiple monitors attached, you can choose different settings for each screen.

Note

If you have a newer Mac that supports the Quartz Extreme graphics technology of OS X 10.2 and later, when desktop pictures change automatically, they’ll fade in and out beautifully. On older Macs, the pictures will simply switch. To find out if your video card supports Quartz Extreme, visit http://www.apple.com/macosx/jaguar/quartzextreme.html.

There’s also a hidden option here. If you select an image that’s significantly smaller than your screen (this generally happens when you choose a picture from a folder of your own choosing or from your iPhoto Library), you’ll get a pop-up menu to choose whether the picture should be tiled across the entire screen; should be displayed at normal size in the center of the screen; should fill the screen using its current aspect ratio (which may result in part of the image being cut off); or should be stretched to fill the screen, not necessarily preserving its width/height ratio.

Add Permanent Folders to the List of Collections
User Level | admin
Affects | computer
Terminal | no

When you choose your own folder of pictures, the most recently used folder will remain in the list of Collections. However, once you choose another folder, the previous custom folder is removed and the new folder takes its place. What if you want to add your own folders to the list of Collections and have them remain there permanently?

The built-in images you see in the Collections list are actually JPEG image files located in /Library/ Desktop Pictures. The various Collections are actually folders of images installed by Mac OS X into that directory (Abstract, Nature, etc.). You’d think that simply creating a new folder inside /Library/ Desktop Pictures would add that folder to the Collection menu. Unfortunately, it’s not that easy. You actually need to edit a hidden file inside the Desktop & Screen Saver preference pane itself, and you need root access to do it. Although it’s possible to edit this file with a text editor, I’m going to show you how to use the developer tool Property List Editor, located at /Developer/Applications/Property List Editor (here’s where installing the Developer Tools comes in handy).

First you’re going to back up the existing file.

  1. In the Finder, navigate to /System/Library/PreferencePanes/
    DesktopScreenEffectsPref.prefPane.

  2. Control/right-click DesktopScreenEffectsPref.prefPane (or select it in the Finder, and click the Finder’s Action menu button), and choose Show Package Contents from the resulting contextual menu.

  3. In the resulting window, navigate to /Contents/Resources.

  4. Control/right-click DesktopPictures.prefPane (or use the Action menu), and again choose Show Package Contents from the contextual menu.

  5. In the resulting window, again navigate to /Contents/Resources.

  6. Copy the file Collections.plist to your user folder (option-drag it to copy it).

Note

If you’re running OS X 10.2, the file used in this exercise is instead /System/Library/PreferencePanes/DesktopPictures.
prefPane/Contents/Resources/Collections.plist.

Now that you have a safe, unmodified backup of the file, you’re going to edit the original to include a new folder. For this example, I’m going to include a folder called Shared Desktop Pictures, located inside the Shared user folder, and I’m going to call the new Collection Shared Pictures.

  1. Quit System Preferences if it’s currently running.

  2. Using your favorite utility, open Property List Editor as root (as described in Chapter 1).

  3. In Property List Editor, choose File Ø Open… and navigate to /System/Library/
    PreferencePanes/DesktopScreenEffectsPref.prefPane/Contents/Resources/
    DesktopPictures.prefPane/Contents/Resources/Collections.plist    . Open this file.

  4. You’ll see a window with a Property List; the only one listed is Root. Click the disclosure triangle next to Root to display the properties contained in it. The resulting properties are the various “stock” Collections listed in the Desktop tab of the Desktop & Screen Saver preference pane. You can click each property’s disclosure triangle to see the various properties contained within it. You’re going to create a new property for your folder.

  5. Select the Root item (the top line in the window), and then click the New Child button in the toolbar. A new property will be created, probably with the number 0 as its name. In the Class column, select the pop-up menu for line 0 and choose Dictionary (Figure 2.5).

    Click To expand
    Figure 2.5: Creating a new property in the preference file for Desktop Picture Collections

  6. Click the disclosure triangle to the left of line 0. (Don’t worry if you don’t see anything after doing this; there’s nothing there yet.) Highlight property 0, and click the New Child button. Change the name of the new property from New item to identifier (double-click the field if it isn’t already editable). Make sure the Class is String. Change the value of the property to Shared Pictures (or whatever you’d like to name your new collection—this is the name that will appear in the Collections list).

  7. Click the line you just edited, and then click the New Sibling button in the toolbar. This will create another property at the same level as the previous one. Change the name of the property to path, make sure its Class is String, and change the Value to the path to the folder of pictures (in my case, /Users/Shared/Shared Desktop Pictures).

    Warning

    If you add a folder to the Collections menu as described here, you’re actually altering the Desktop & Screen Saver preferences pane itself. Therefore, the new folder must be accessible by all users; don’t use a folder inside your home folder.

  8. If you’d like to see the Fill/Stretch/Center/Tile menu for the pictures in this collection, add one more sibling (click the path property, and then click the New Sibling button). Change the name to showScalingPopUp, make sure it’s a String class, and change the Value to YES.

  9. When you’re done, choose File Ø Save to save your changes.

The next time you launch System Preferences and switch to the Desktop tab of the Desktop & Screen Saver pane, your folder of images will be shown in the list of Collections. You can add and remove pictures at will, making this one of the most convenient ways to get quick access to custom images.

Tip

If you just want to add a single picture to the list of available Desktop backgrounds, just drag the picture into / Library/Desktop Pictures; the next time you launch System Preferences and switch to the Desktop & Screen Saver pane, your picture will appear in the Apple Background Images Collection.

Rotate Photos from Multiple Folders
User Level | any
Affects | individual user
Terminal | no

Although Mac OS X by itself doesn’t allow you to rotate Desktop photos from multiple folders/ locations, and it doesn’t browse subfolders for enclosed pictures, you can do these things quite easily with third-party software. My personal favorite is the freeware ChangeDesktop by Brian Bergstrand (http://www.classicalguitar.net/brian/software/changedesktop/). In addition to doing everything the Desktop tab of the Desktop & Screen Saver preference pane can do, it allows you to pick any number of folders full of pictures and enable or disable them from the rotation at will. It also lets you "publish" your desktop picture to the Web or any FTP server, and it has extra options for things like iPhoto archives. Even better, it also provides the option to add a menu item to the menu bar for easy access.

There’s actually one more really cool Desktop tip that I have to tell you about, but I’m going to save it for the next section (where I talk about the Screen Saver tab).

The Screen Saver Tab

The Screen Saver tab controls one of Mac OS X’s “almost useless but very cool” features: the screen saver. I say almost useless because the truth is that nowadays most screens don’t suffer the same “burnin” effect that spurred the development of screen savers 10 or 15 years ago. I say very cool because OS X’s screen saver takes advantage of the graphics technologies of OpenGL and Quartz Extreme to provide some impressive effects.

You can select a screen saver module from the Screen Savers list on the left; a sample of that screen saver appears in the Preview window on the right. If the module provides configuration options, clicking the Options button brings up a configuration dialog. The Test button simply shows you a full- screen example of what your configured screen saver will look like; moving the mouse or pressing a key will end the test.

You have two options for starting your screen saver: idle time or “hot corners.” The “Start screen saver” slider lets you decide whether or not the screen saver should start automatically after a certain amount of idle time (no mouse or keyboard activity) and how long you want that time period to be. (Set it to Never if you don’t want time-based activation.)

The Hot Corners button brings up a dialog that lets you use the corners of your screen either to start the screen saver or to prevent the screen saver from starting (Figure 2.6). To configure this option, select the pop-up menu next to the desired corner of the sample screen. Choose Start Screen Saver to have the screen saver started immediately if the cursor is moved all the way into that corner of your screen; this can be useful if you’ve enabled password protection on the screen saver and are about to step away from your desk, or if you need to quickly hide the screen. Select Disable Screen Saver to prevent the screen saver from starting, even if your computer is idle longer than the time you’ve chosen from the time slider, if the cursor is placed in that corner; this is a great way to prevent the screen saver from starting up while you’re doing something that doesn’t require any mouse/ keyboard input (such as watching video on the Web). (The pop-up menus in the Hot Corners configuration dialog also contain items for activating various modes of the Exposé feature of Mac OS X; I’ll talk about Exposé in Chapter 7.)

Figure 2.6: The Hot Corners configuration dialog of Screen Saver preferences
Note

If you have multiple displays, choosing a corner of the sample screen for a screen saver action will apply that setting to all screens; however, in order for the corner action to work on a particular screen, that screen’s corner must “stop” the mouse cursor. In other words, if moving the cursor to a corner of a screen results in the cursor moving to another screen, that corner will not be able to trigger any screen saver actions.

In addition to the stock features of the Screen Saver tab, you can also use the screen saver as a very nice slide show application, add custom screen savers, and even animate the Desktop, as explained in the sections that follow.

Tip

You can require a password when “waking” from the screen saver via the Security tab of System Preferences (by enabling the “Require password to wake this computer from sleep or screen saver” option). Although this isn’t foolproof security, it’s at least an easy way to make sure that others don’t access your account when you’re not sitting in front of your computer, without you having to log out. (When I talk about system security in Chapter 13, I’ll show you how to immediately lock your screen behind a password-protected screen saver, regardless of your settings here.)

Use the Screen Saver for Photo Slide Shows
User Level | any
Affects | individual user
Terminal | no

One of the built-in screen saver modules is called Pictures Folder. This module takes images from your ~/Pictures folder and presents them as a slide show. You can customize this slide show in a few ways—transition effects, randomization, cropping, position, etc.—using the Options screen. In addition to being a neat screen saver, you can use this module to show off pictures to friends and relatives (and watch them be impressed by the stylish transitions Mac OS X is capable of displaying).

However, as of Mac OS X 10.3, you can also view your iPhoto Library, and individual iPhoto albums, as slide show screen savers. Simply select your Library, or an album, from the Screen Savers list. (They’re at the bottom of the list.) You have the same configuration options as with the Pictures Folder module.

Tip

If you or someone you know has a .Mac account (formerly iTools), and has published a public slide show (I’ll talk more about that in Chapter 7), you can instead select the .Mac screen saver module, which is exactly the same as the Pictures Folder module except that it accesses .Mac slide shows over the Internet. Click the Options button and then enter the person’s .Mac member name in the appropriate field. (If you’ve entered more than one .Mac member name, you can select which ones you want to view by checking or unchecking the box next to each in the Options window.)

Install New Screen Savers
User Level | normal or admin
Affects | individual user or computer
Terminal | no

Mac OS X comes with a good variety of screen savers, some simple, some quite impressive. However, there are many other good screen saver modules floating around the Web that you can install, and doing so is quite easy. Here’s how:

  1. Quit System Preferences.

  2. Find a screen saver you want to install. If you don’t have any yet, check the sidebar “Fave Savers,” or do a search for “saver” on VersionTracker.com or MacUpdate.com. (The name of the file should end in .saver.)

  3. If you’re a normal user, or an admin user who wants the screen saver to be available only for your personal use, drop it in ~/Library/Screen Savers. If you’re an admin user and you want the new screen saver to be available to all users, drop it in /Library/Screen Savers.

Start Sidebar
Fave Savers

There are many, many third-party screen saver modules available on the ’net—a search on Version Tracker will give you eight or nine pages of results. I’ve included below a short list of what I think are especially worthy screen saver modules:

Bumps (http://spazioinwind.libero.it/tpecorella/
uselesssoft/software.htm): Turns your screen into an embossed metallic surface, and then hides it in the dark, revealing portions under a spotlight. Check out their other modules while you’re there.

CosmoSaver (http://www.cosmosaver.com/): Takes you on a tour of (an accurate representation of) our solar system, complete with 3D planets, their moons, and their orbits. You can even see time- accurate cloud cover for Earth!

Euphoria (http://s.sudre.free.fr/Software/Euphoria.html): A beautiful OpenGL screen saver with futuristic "plasma" effects (my description, not the developer’s).

Fireflies (http://s.sudre.free.fr/Software/Fireflies.html): Similar to Euphoria, but with "swarms" of OpenGL streams.

Fluid (http://www.concepthouse.com/products/Fluid/): Makes your screen look like molten metal.

Galaxy (http://www.epicware.com/macosxsavers.html): Displays an impressive 3D image of a rotating galaxy. Browse their other screen savers while you’re there.

Marine Aquarium (http://www.serenescreen.com/): The most incredible screen saver I’ve ever seen, it provides a photo-realistic saltwater aquarium complete with 20 species of tropical fish and a starfish that crawls up the glass. It’s not free, but it’s well worth the $20 just to impress your friends.

Old Glory (http://homepage.mac.com/mtrent/FileSharing.html): If you’re partial to U.S. flags, this one will do your Mac justice with its realistic animation.

Click To expand

Plasma Tunnel (http://www.fruitz-of-dojo.de/php/download.php4): A spooky trip down a 3D tunnel.

ScriptSaver (http://homepage.mac.com/swannman/FileSharing1.html): A unique module that launches the AppleScript of your choice when it activates.

Time Ballz (http://www.xscreensavers.com/timeballz/): Everyone needs a clock screen saver; this is my favorite.

End Sidebar

The next time you launch System Preferences, the new module will be available in the Screen Saver tab of Desktop & Screen Saver preferences.

Create Your Own Slide Show Savers

As I explained above, the Pictures Folder module will cycle through the images in your ~/Pictures directory, and you can use your iPhoto albums as slide show screen savers, as well. But what if you want to create your own "permanent" slide show of pictures? What if you want to create such a slide show module so you can give it to friends and family? You can do it very easily.

  1. Create a new folder.

  2. Copy any pictures you want in the slide show into the folder (you can even use aliases to the pictures if the new screen saver module is only going to be used on your own computer).

  3. Rename the folder name.slideSaver, where name is the name you want to appear in the Screen Saver list of modules. You’ll be asked if you’re sure you want to use the .slideSaver suffix; yes, you really do (click the Add button). This will change the folder into a screen saver package. (I talk more about packages in Chapter 4.)

  4. Drag the new folder into one of the Screen Savers folders described in the previous tip.

The next time you launch System Preferences, your new slide show will be listed in the Screen Saver tab; you can even use the Configure screen to choose the presentation options. If you want, you can e-mail your slide show module to other Mac OS X users, and they can use it, as well.

Tip

You can also create a new slide show screen saver by dragging a folder of images onto /Library/Image Capture/ Scripts/Build slide show. This handy little app will create a new module called Recent Photos.slideSaver inside your personal ~/Library/Screen Savers directory (you can rename it something more meaningful in the Finder).

Animate the Desktop
User Level | any
Affects | individual user
Terminal | no

Have you ever liked a screen saver so much that you wished you could watch it even while you were working? Evidently someone at Apple has. Mac OS X 10.2 provides the ability—called Desktop Effects—to enable any screen saver module as your entire Desktop. You can even use the incredible Marine Aquarium (mentioned in “Fave Savers”) and watch fish swim across your Desktop.

Unfortunately, as I was researching this second edition of Mac OS X Power Tools, I discovered that Apple “broke” Desktop Effects in OS X 10.3—it still works, but when you enable it, many features provided by the Dock, including Exposé and the command-tab application switcher, no longer work. Fortunately, I also discovered that a piece of software I recommended in the first edition of the book provides the same functionality as Desktop Effects but doesn’t use Apple’s (now broken) approach. That software is the shareware xBack (http://www.gideonsoftworks.com/xback.html). It provides a universal menu in the menu bar that allows you to start and stop a "desktop screen saver," as well as the ability to quickly choose which saver module to use.

Note

Some Desktop Effects are very processor intensive, so if you’re doing work that requires a lot of processing power, you may be better off with a desktop picture instead.

Dock

User Level | any
Affects | individual user
Terminal | no

The Dock pane is where you customize the appearance and behavior of the Dock. Because I dedicate an entire chapter to the Dock (Chapter 6), and because my editors don’t want me to repeat myself too much, I’ll simply refer you to that chapter for all the nitty-gritty.

Exposé

User Level | any
Affects | individual user
Terminal | no

You use the Exposé pane to choose your settings for the Exposé window management feature of Mac OS X 10.3 and later. I discuss Exposé in detail in Chapter 7.

International

User Level | any
Affects | individual user
Terminal | no

Here’s where you decide how your Mac handles different languages, character sets, and punctuation. If English is your only language, and you live in the United States, you may think you never need to touch this group of settings. However, there are a few neat things to be found here, even for English-speaking Americans.

The Language Tab

Unfortunately, although the Mac OS itself may be multilingual, many applications aren’t, or if they are, they don’t necessarily support the languages you’d like them to support. In earlier versions of the Mac OS, if you selected a foreign language, such as Spanish, for your preferred language, there was no way to tell your Mac what to do if an application didn’t provide language support. In Mac OS X, you can actually prioritize your languages. First, click the Edit… button in the Languages tab and check only those languages you speak/read, or at least want to keep as options (it’s actually pretty amazing how many are there!). When you click OK, the Languages window will now list only those you’ve selected. Here’s the neat part: Rearrange them in your preferred order, and Mac OS X will use these languages (in the Finder and in applications) in that order, provided applications support them. For example, if you select Español, Italiano, and English, in that order, the next time you launch an application, OS X will check to see if that application supports Spanish; if it does, it will run as a Spanish- language application. If not, OS X checks to see if it supports Italian, and so on down the list until a supported language is found.

The Customize Sorting… button provides you with the opportunity to select text behavior (sorting, case, dictionaries, etc.) for each type of script (character set) supported by Mac OS X. For example, if you select Roman script, the Behaviors pop-up menu will present all the possible behaviors (in this case, languages) supported for that script. Choose the one that’s the most appropriate for the language you use with your Mac.

The Formats Tab (Date, Time, and Numbers Tabs in OS X 10.2)

Different countries, and sometimes even different regions within the same country, use various methods for writing the day and date, the time, and numbers. Mac OS X has many such regional formats built-in, and you can choose these from the Region pop-up menu of the Formats tab. (If you enable the “Show all regions” option, the Region pop-up will include subregions for each region.) Once you select a particular region, you can customize its settings for Dates, Times, and Numbers by clicking the Customize… button in each section. The Numbers section even lets you choose the currency symbol and whether you want to use Metric or Standard (U.S.) measurement systems. The shaded/ recessed area in each section provides an example of how your selected preferences will look.

Note

In versions of OS X prior to 10.2, the only place you could switch between 12-hour and 24-hour clock formats was in International preferences. Many users complained that this setting belonged instead in the Date & Time preferences. Apple responded by putting the setting in Date & Time but leaving it in International, as well. This is, as far as I know, the only non-admin-level setting in all of Mac OS X that can be changed via two entirely different preference panes.

The Input Menu Tab

If you use multiple languages on your Mac, you may find that at different times you need access to non-English keyboard layouts, or at least non-English characters. If you select more than one language in the Input Menu tab, an input menu will appear in the menu bar—it will look like the flag of the country of your preferred language—that lets you quickly switch between keyboard layouts.

In addition, in what is a very cool feature of Mac OS X 10.2 and later, if you select Character Palette, the input menu will include a new item, Show Character Palette. Choosing this item will show the palette as a window that floats over the top of other applications (Figure 2.7). You can view characters from any input type, with characters grouped by category. You can insert a character from the palette into an active text field by double-clicking the character in the palette. (You can also add a character to your “favorite” character list if it’s one you access frequently.) The Character Info disclosure triangle shows you info about the font, including related characters, and the Font Variation disclosure triangle shows other font(s) in which the character is available. If you choose Unicode from the View pop-up menu, you can see Unicode blocks and a full Unicode table via the tabs across the top of the palette.

All in all, this is a great feature that most people never realize exists. If you’ve enabled the Japanese Kana Palette item in the Input Menu tab of International preferences, you can access a similar palette for Japanese Kana characters from the input menu. Finally, if you enable the Keyboard Viewer item, the menu will include the ability to view OS X’s Keyboard Viewer (described in detail in Chapter 7).

Security

User Level | any or admin, depending on setting
Affects | individual user or computer
Terminal | no

The Security pane provides a number of security-related settings, some accessible to each user, others that affect the computer as a whole (and thus are available only to admin users). I discuss these options in Chapter 13.

Figure 2.7: The Character Palette lets you choose any character in any font.

The Hardware Category in System Preferences

The Hardware category of System Preferences is filled with settings that affect how users interact with their Mac’s hardware. Unless their accounts have been restricted by an admin, normal users can access every pane and can change settings for all but the Energy Saver panel (which can be used only by admin users).

Bluetooth

User Level | any, unless limited by an admin
Affects | individual user
Terminal | no

The Bluetooth pane lets you configure your settings for OS X’s short-range, wireless networking technology, Bluetooth. The panel appears only if your Mac has built-in Bluetooth support or a Blue- tooth adapter attached. I’ll talk more about setting up this pane in Chapter 9.

CDs & DVDs

User Level | any, unless limited by an admin
Affects | individual user
Terminal | no

In this panel each user can decide what they want OS X to do when they insert different kinds of media. For example, when you insert a music CD, you have several options: You can have OS X automatically open iTunes for you; you can have another application launch (perhaps another

audio program or player); you can tell the OS to run an AppleScript; or you can tell OS X to do nothing, and the CD will simply mount in the Finder. The AppleScript option is the most intriguing because with a little bit of practice using AppleScript, you can do things you never imagined. For example, you could create a script that opens iTunes, converts all of the songs on your CD to MP3, copies all the track names from the CD, opens an existing document in TextEdit that contains a list of all your MP3s, pastes the names of the tracks into the document, saves the document, quits TextEdit, then ejects the CD. Writing such a script is beyond the scope of this book, but I hope my example shows you that even such an apparently simply preference pane such as CDs & DVDs can be quite powerful.

Tip

If you hold down the option key when you click one of the action pop-up menus, a new Options… item appears. If you choose this item, a sheet will drop down with the option “Perform action at login.” Enabling this option causes the action you select to be executed when you log in. For example, if you’ve chosen to open iTunes when you insert a music CD and enabled the “Perform action at login” option, if a music CD is in the drive when you log in, iTunes will launch automatically.

Displays

User Level | any, unless limited by an admin
Affects | individual user
Terminal | no

The Display tab of the Displays pane allows you to change the performance of your CRT or LCD display: resolution, brightness, color depth, and (for CRTs) refresh rate. You can also choose whether or not to show a menu for display settings in the menu bar (click the “Show displays in menu bar” box). Via the Color tab, Displays also allows you to select or create a Display Profile to be used for ColorSync. (I talk more about ColorSync in Chapter 7.)

Tip

If you have an older Mac, choosing Thousands of colors instead of Millions can decrease the load on your video card and squeeze a little more performance out of OS X. (Interestingly enough, if you have a newer Mac, you may actually get better performance by choosing Millions—many newer video cards are optimized for 32-bit graphics.)

If you have multiple displays/monitors connected to your Mac, an Arrangement tab will appear that shows graphical representations of each screen. By moving those screens around, you tell Mac OS X how your displays are located, physically, in relation to one another—so that your on- screen “extended Desktop” matches your actual one. By dragging the menu bar from one screen to another, you change which is officially your main screen (the one hosting the menu bar). In addition, each of your displays will get its own Displays preference window, containing Display and Color tabs, allowing you to control each independently. If you enable the Mirror Displays option in the main window, your multiple screens will no longer operate as an extended display, but rather will operate as multiple instances of the same screen, all mirroring the main display.

Tip

To quickly access the Displays pane of System Preferences, hold down the option key and press one of the brightness keys on a PowerBook or iBook, or hold down option and press the brightness button on an Apple display. System Preferences will launch with the Displays pane already selected.

In addition to these features, if you have multiple displays or if your Mac is a PowerBook or iBook, an additional button, Detect Displays, appears in the Display tab. Clicking this button tells your Mac to check whether or not an additional display is connected, and, if so, to enable video to it. This is especially useful when connecting your laptop to an external monitor or video projector. PowerBook and iBook users, and users with an Apple LCD display, also have a Brightness slider that allows you to change the brightness of the LCD display. Finally, if you have a newer PowerBook with a backlit keyboard, the “Automatically adjust brightness as ambient light changes” option automatically dims both the display and keyboard backlighting as ambient light decreases and automatically brightens both as ambient light increases.

Another nice feature on newer PowerBooks and iBooks is the ability to change screen brightness without opening System Preferences. On these laptops the F1 and F2 keys serve double duty as dimmer and brighter, respectively. In addition, if you have an external display connected to your laptop, you can toggle between mirroring and “extended Desktop” using the F7 key. Similarly, pressing command+[decrease brightness button] will toggle mirroring, and pressing command+[increase brightness button] will execute the “detect displays” command.

Tip

If you have a newer Apple LCD monitor with “touch-sensitive” controls on the front, you may sometimes get frustrated that the slightest brush of the hand changes the brightness, or even turns the monitor off. Some users have found that their display’s buttons are so sensitive that even static electricity can activate them! If this sounds familiar, first quit System Preferences if it’s currently running. Then press and hold shift+command and touch the brightness control on the front of the display. This should launch System Preferences and open it to the Displays pane, with an additional tab called Options, which contains a single option: the ability to turn the touch switches off. (If the above procedure doesn’t work, first open System Preferences, and then hold down shift+command as you click the Displays icon.)

Energy Saver

User Level | admin
Affects | all users
Terminal | no

The Energy Saver panel lets you decide how frugal your Mac is with electricity (on all Macs) and battery power (on laptops). On a desktop Mac, the settings in the Sleep tab are pretty straightforward. You can set your system to automatically sleep after a certain amount of inactivity (and set the display for a different time, if desired). You can also choose to have the hard drive sleep (which simply means it will stop spinning) whenever you aren’t using it. The Options tab provides you with settings that allow your Mac to wake from sleep when your modem detects an incoming call (for faxes or dial-up remote access), to wake from sleep for certain types of network access, and to automatically restart after a power failure. On some Macs, you can also elect to use the power button to put the computer to sleep instead of shutting down. Finally, on Power Mac G5 computers, the Options tab includes an additional Processor Performance setting. Most users will want to leave this setting as Automatic, which automatically reduces processor usage when possible (to reduce power consumption and keep the computer cool), but ramps up the processor(s) when needed.

Tip

In OS X 10.2 and later, Apple removed the time setting for hard disk sleep; whereas in earlier versions of OS X you could choose the length of inactivity after which the hard drive would spin down, you now simply get a toggle to “Put the hard disk to sleep when possible” (which defaults to 10 minutes of inactivity). You can actually set the length of the inactivity trigger using Terminal. The command is sudo pmset -x spindown minutes, where x should be b for battery settings, c for AC adapter settings, or a for both ("all"), and minutes is the number of minutes of inactivity before the hard drive spins down. So to set the hard drive spindown time to always be five minutes, you’d type sudo pmset -a spindown 5 <RETURN>.

The Schedule tab, new starting with Mac OS X 10.3 but old hat to Mac OS 9 users, allows you to automatically start your Mac up either once every day, once a day on weekdays, or once a day on weekends; you decide on the actual time. You can also set a second schedule that allows you to either put your Mac to sleep or shut it down (with similar day/time options).

Tip

If you find OS X’s limit of two schedules—one for startup, and another for either sleep or shutdown—too limiting, check out the shareware iBeeZz (http://www.ibeezz.com/). iBeeZz lets you schedule multiple events—start up, wake up, sleep, shut down, restart, even opening files or playing songs in iTunes—each at a specific time on whatever days you choose.

Note

You can use the Desktop & Screen Saver pane of System Preferences to enable the option to automatically start the screen saver after a set period of inactivity and at the same time enable the “Use separate time to put the display to sleep” option in Energy Saver preferences. However, if your time setting in Energy Saver preferences is shorter than your Screen Saver time setting, the Energy Saver pane will alert you to this fact and a Screen Saver… button will appear to let you quickly switch to Screen Saver preferences so you can shorten your Screen Saver time setting.

Finally, in OS X 10.3.3 and later, if you have an Uninterruptible Power Supply (UPS) connected to your Mac via USB (with the appropriate software installed), a new UPS tab will appear that provides a number of options relating to UPS functionality. Specifically, you can set up your Mac to automatically shut down after a certain amount of time running off the UPS, or when a certain amount of time/ power is remaining on the UPS. (You can even view your UPS's current battery level.)

If you’re using a PowerBook or iBook, the Energy Saver panel looks significantly different and has a few additional features. At the bottom of the window is a checkbox to show the status of your battery in the menu bar; if this is checked, a battery icon appears in the menu bar. (Clicking the battery icon in the menu bar provides you with a menu to choose how you want the indicator to appear.) The window also includes a text description of the current energy saver settings and the status of the battery.

By default, the laptop version of Energy Saver shows only one other setting, the Optimize Energy Settings pop-up menu, which has several preset combinations of energy settings: Highest Performance maxes out processor and hard drive performance and screen brightness, but leads to shortened battery life; Longest Battery Life provides the lowest overall level of performance, but provides the best battery life; DVD Playback optimizes the settings for watching DVDs; and Presentations provides good processor performance and prevents the screen from sleeping (even if you’re running off of the battery), but saves some battery life by allowing the hard drive to spin down. By selecting Automatic, OS X will automatically change settings for you depending on whether you’re using the AC adapter or the internal battery, as well as whether or not an external display is attached. You’ll also see a setting called Custom; when you choose this option, you can create your own set of Energy Saver settings, using the Show Details button.

Note

The options that appear in Energy Saver preferences differ depending on your Mac model. Visit http://docs.info.apple.com/article.html?artnum=106790 for Apple’s official notes on which models have which options.

If you click Show Details, you’ll see Sleep and Schedule tabs that are basically identical to that of a desktop Mac (Figure 2.8). The Option tab is also similar, with the exception of after the Processor Performance setting (Reduce Processor Performance on some laptop models). Highest performance (or Reduce Processor Performance Off) requires more power and is best used when your PowerBook or iBook is using an AC adapter; reduced performance (or Reduce Processor Performance On) reduces the processor speed to conserve battery power. You won’t be able to crunch numbers as quickly, but your batteries will last longer. Again, on laptops all the settings in the Energy Saver preference pane are configured automatically based on your chosen preset in the Optimize Energy Settings pop-up menu. If you make any changes manually, the preset will change to Custom, and your changes will be applied to the Custom configuration.

Click To expand
Figure 2.8: Energy Saver on a desktop (left) and a laptop (right)
Tip

On most Macs and PowerBooks, you can put your computer to sleep immediately and completely, fan and all, by pressing command+option+eject.

Ink

User Level | any, unless limited by an admin
Affects | individual user
Terminal | no

This panel lets you set your preferences for the built-in handwriting recognition abilities of OS X 10.2 and later. It will be visible only if you have an Ink-compatible tablet or writing device connected to your Mac. I’ll talk a bit more about Ink in Chapter 7.

Keyboard & Mouse

User Level | any
Affects | individual user
Terminal | no

With every new version of Mac OS X, it seems like Apple increases the number of keyboard- and mouse-related settings and changes how these settings are organized. In versions of Mac OS X prior to 10.3, keyboard-related preferences were in a separate Keyboard pane, and mouse/trackpad-related preferences were in an independent Mouse pane; each had one or more tabs within it, depending on your computer. However, with OS X 10.3, Apple combined these two preference panels into a single Keyboard & Mouse pane. (The most likely reasons for this change are two-fold: to group all “input device” settings together and because of the need for a single location to control Bluetooth input devices, as described below.) Depending on your hardware configuration, the Keyboard & Mouse pane can have anywhere from three to five tabs, including Keyboard, Mouse, Trackpad, Bluetooth, and Keyboard Shortcuts. Because they contain so many different settings, I’ll talk about each tab separately.

The Keyboard Tab

On all Macs, the Keyboard tab lets you set the key repeat rate (with what frequency a character is typed when you hold its key down) and the delay until such repeating begins.

If you have a newer PowerBook with keyboard backlighting, the “Illuminate keyboard in low light conditions” option appears, which allows you to enable this feature. The “Turn off when computer is not used for” slider is a bit like a “screen saver” for backlighting—in order to conserve battery power, your PowerBook can automatically turn off the backlight after a period of inactivity designated here. (You can also have your PowerBook automatically adjust the brightness of the keyboard’s backlight based on the level of ambient lighting. I discussed this feature when I talked about the Displays panel.)

If you're running Mac OS X 10.3.3 or later on a newer PowerBook or iBook, another option appears: “Use the F1-F12 keys for custom actions.” Normally, these newer laptops use some of the F-keys—F1 through F7, or even through F10, depending on the model—for changing system settings such as screen brightness, volume, etc.; if you want to use the F-keys as F-keys, you need to hold down the fn key. This option, when enabled, lets you reverse F-key functionality so that your F-keys work as F-keys by default; you then hold down the fn key to change system settings.

The Mouse Tab

The Mouse tab appears on desktop Macs and on PowerBooks and iBooks with a mouse connected. Its settings are fairly self-explanatory: You can choose the mouse’s tracking speed, how fast you need to double-click for OS X to recognize it as a double-click (rather than two single clicks), and how fast documents scroll when using your mouse’s scroll wheel (if applicable).

The Trackpad Tab

If your computer is a PowerBook or iBook, a separate Trackpad tab will appear. It has the same Tracking Speed and Double-Click Speed settings as the Mouse tab, but these settings apply to the trackpad. (In fact, if you also have a mouse connected to your laptop, you can choose different settings for each.)

In addition, the Trackpad tab has some unique trackpad-only settings in the “Use trackpad for” section. If you enable the Clicking option, you can avoid using the trackpad button at all—you can tap the trackpad instead. If you have the Dragging box checked, a tap on the trackpad followed immediately by a tap/drag functions just like holding down the trackpad button while moving your finger across the trackpad—at times a difficult maneuver. (You can also enable the Drag Lock feature, which works the same as the Dragging option except that you have to tap the trackpad again to “release” the drag.) Another nice feature is the ability to tell OS X to ignore the trackpad while you’re typing (via the “Ignore accidental trackpad input” option)—a document saver for those of us who tend to drag our thumbs when we type. Finally, you can even disable the trackpad completely when a mouse is plugged in.

The Bluetooth Tab

If your Mac has built-in support for Bluetooth, or has a Bluetooth adapter connected, a Bluetooth tab will appear in Keyboard & Mouse preferences that lets you monitor and configure Bluetooth input devices. If you’ve already paired a Bluetooth mouse and/or keyboard with your Mac, the Bluetooth Mouse and Bluetooth Keyboard sections show the name of the connected device(s), as well as the battery level of each. You can choose to enable the Bluetooth menu extra, which provides a Bluetooth menu in the menu bar. (I talk more about this menu in Chapters 9 and 10 when I discuss Bluetooth and using Bluetooth for sharing files.) You can also enable the option to allow Bluetooth devices to wake your Mac; if this option is disabled, you’ll be able to wake your computer only by using “wired” input devices or the power button.

If you haven’t already paired your Bluetooth input device(s) with your Mac, clicking the Set Up New Device… button will launch the Bluetooth Setup Assistant to walk you through the process.

The Keyboard Shortcuts Tab

New in OS X 10.3, the Keyboard Shortcuts tab combines the Full Keyboard Access feature of earlier versions of the OS with newer keyboard shortcut functionality to provide a one-stop place for all of OS X’s features relating to keyboard control.

Full Keyboard Access At the bottom of the tab is an option called “Turn on full keyboard access.” This feature is far more powerful than its single checkbox would imply. If Full Keyboard Access is enabled, you can access almost any interface element using the keyboard. In dialogs and in many applications, you can press the tab key to cycle through buttons, menus, etc. (Once a button or check- box is highlighted, press control+F7 to activate/deactivate it; once a menu is selected, you can use the arrow keys to navigate through menu items, and then press the return key to choose a selected menu item.) Even better, you can use the keyboard combinations listed below to “activate” particular inter- face elements; once one is active, you can navigate around it using the tab and arrow keys. For example, if I want to choose a different style for this paragraph as I’m typing it in Word, I simply press control+M to enable the menu bar, press the right arrow a few times to get to the Style menu, then use the down arrow to highlight the desired style; pressing the return key selects it.

control+F1 | Turn Full Keyboard Access on/off.
control+M or control+F2 | Focus Full Keyboard Access on the menu bar.
control+D or control+F3 | Focus Full Keyboard Access on the Dock.
control+W or control+F4 | Focus Full Keyboard Access on the active window or the next window behind it.
control+T or control+F5 | Focus Full Keyboard Access on the toolbar of the current window.
control+U or control+F6 | Focus Full Keyboard Access on a tool palette (press again to cycle through palettes).
tab | Cycle through controls/options in the current window.
control+F7 | Toggle focus/setting for the currently selected control/option.
space | “Press” the highlighted/focused control/option.

(On PowerBooks and iBooks, use fn+control+key instead of control+key for the commands above.)

Combined with Mac OS X’s ability to switch between applications using command+tab and between windows using command+~ (more on those in Chapter 6), and to control the mouse cursor with the keyboard (described later in this chapter when I discuss the Universal Access pane), you can do pretty much anything without using the mouse. This functionality comes in handy more than you might think. I’ve even had a few situations where my mouse stopped responding, but I was able to finish what I was doing by using full keyboard access.

Keyboard Shortcuts The rest of the Keyboard Shortcuts tab is actually the “meat” of keyboard shortcut functionality in OS X. Listed here are a good number of Mac OS X’s built-in global (system- wide) keyboard shortcuts—keys that, when pressed together, execute the command/function listed next to them; these shortcuts work regardless of what application is currently active. You can deactivate particular shortcuts by unchecking the On box next to them, and you can edit a shortcut’s key combo by double-clicking it in the Shortcut column to highlight it for editing (or clicking once and then waiting for it to become editable), and then pressing the new keyboard combo. (Some changes won’t take effect until you log out and then log back in.)

Start Sidebar
Keyboard Shortcut Symbols

If you’re having trouble figuring out what the particular symbols in the Keyboard Shortcuts listing are, here’s a list of the ones you’re most likely to see:

ñ | Shift key
^ | Control key
 | Option key
z | Command key
 | Enter key on the keypad
R | Escape key (the “esc” key at the upper left of the keyboard)
Õ | Delete key
F# | Function keys (the “F” keys across the top of the keyboard); on PowerBooks and iBooks, you may need to press the fn key along with the listed combination (see “The Keyboard Tab” for more information).
End Sidebar

But the real power of the Keyboard Shortcuts tab lies in its ability to create custom shortcuts— both ones that work system-wide and ones that work in only particular applications. (Remember, the Finder is an application.) You can create a shortcut for almost any command that appears in a menu in any application. Here’s how:

  1. Quit the application for which you want to create a shortcut. (If you’re creating a shortcut for the Finder, you can ignore this step, but you’ll want to immediately log out and then back in (or force quit the Finder) for the change to “stick.” Likewise, if you create a global shortcut, you’ll want to log out and back in afterward.)

  2. Open the Keyboard Shortcuts tab if it’s not already open.

  3. Click the Add (+) button.

  4. In the resulting dialog, first choose the appropriate application from the Application pop-up menu. For global shortcuts, choose All Applications. If the desired application isn’t listed, choose Other… and then navigate to the application in the Open dialog that appears.

  5. Next you need to type the name of the menu item/command for which you’re creating a keyboard shortcut. This step can be confusing, for two reasons. First, you don’t need to include the name of the menu itself, only the specific command. For example, if you want to create a keyboard shortcut for the Window Ø Bring All to Front command, you need to type only Bring All to Front. Second, you need to type the command exactly as it appears in the menu, including case and punctuation. The latter can be especially tricky since some menu commands in the Mac OS include multiple consecutive spaces and/or ellipses (…). To type the latter, you can generally press option+; (that’s option+semicolon). (You can also find the ellipsis character using the Character Palette, discussed in this chapter, or the Keyboard Viewer palette, discussed in Chapter 7.) If for some reason typing a real ellipsis doesn’t work, try using three consecutive periods, instead; the developer of the application may not have followed Apple’s menu guidelines.

  6. Finally, click inside the Keyboard Shortcut field and then press your desired keyboard shortcut (Figure 2.9). The shortcut should consist of one or more modifiers (shift, command, option, control) and one non-modifier key. Unfortunately, the Keyboard Shortcuts tab won’t let you create shortcuts that consist of just the command key and another key (and you of course can’t use shift+key since that’s a standard keyboard command for typing a capital letter); if you only want to use a single modifier, it must be either control or option. (Overall, I highly recommend using at least two modifier keys in your shortcuts; using only option or only control runs the risk of overlapping other menu commands or even text characters. For example, many special keyboard characters are accessed by pressing option+key; if you assign a keyboard shortcut to the same combination, and then later try to type that particular character, the result could be quite unexpected!)

    Tip

    The Keyboard Shortcuts tab will prevent you from creating a shortcut with the same keyboard combination used by a built-in shortcut. However, it will let you create a shortcut that conflicts with another of your own custom shortcuts. When this happens, a small, yellow “alert” sign will appear next to each shortcut that conflicts.

  7. Click Add to create the new shortcut; it will be listed at the bottom of the list under Application Keyboard Shortcuts. (These custom shortcuts don’t have the On checkbox, so they can’t be temporarily enabled/disabled.)

    Figure 2.9: Creating a new, system-wide, keyboard shortcut

Tip

If you’ve activated the Script Menu (as described in the online supplement to Chapter 5), you can assign keyboard shortcuts to scripts located in that menu—simply use the exact name of the script as it appears in the menu. If you’re an AppleScript guru, this means Mac OS X’s keyboard shortcuts can be extremely powerful—anything you can do with an AppleScript can be activated from the keyboard!

Tip

It’s actually possible to create command key–only shortcuts in OS X; however, it requires some complex editing of configuration files. I instead recommend that you check out Unsanity’s Menu Master (http://www.unsanity.com/haxies/menumaster/). Not only does Menu Master allow you to create command key–only shortcuts, it’s also much easier to use than OS X’s own keyboard shortcut functionality. To create a new keyboard shortcut using Menu Master, you simply click the appropriate menu, highlight the item in that menu for which you want to create a shortcut, and then press the desired combination of keys on your keyboard. You delete a custom shortcut by highlighting the appropriate menu item and then pressing the delete key.

Start Sidebar
Keyboard/Mouse/Trackpad Enhancements

Despite its cool keyboard functionality, some users still find OS X’s keyboard control to be a bit lacking, or at least inconvenient. In addition to Menu Master, mentioned in the main text of this chapter, and the keyboard application- and file-launching utilities mentioned in Chapters 5 and 6, here are a few utilities that can improve your input experiences. I’ve also included a few third-party add-ons that enhance mouse/ trackpad functionality.

uControl (http://gnufoo.org/ucontrol/): Originally developed for laptops, but useful even for desktop computers, this utility provides mouse/trackpad scrolling, which allows you scroll documents by holding down a modifier key and then moving the mouse or moving your finger across the trackpad. You can also remap modifier keys; for example, if you never use the enter key on your iBook, you can make it serve as a second option key instead.

SideTrack (http://www.ragingmenace.com/): Another laptop-focused solution, SideTrack is a replacement driver for the trackpad on iBooks and PowerBooks. With SideTrack installed, you can use portions of your trackpad for scrolling by simply dragging your finger up/down or left/right.

Smart Scroll X (http://www.marcmoini.com/sx_en.html): This add-on lets you scroll through documents by pressing specific keyboard combinations. If you forget your chosen key combos, Smart Scroll X can show you an on-screen guide.

MaxiMice (http://www.catchysoftware.com/products/maximice/): MaxiMice lets you scroll through documents (in Cocoa applications) by simply moving the mouse. Place the cursor near the edge of a document window, and the document will be scrolled in that direction; the closer to the edge you move the cursor, the faster the document is scrolled. You can also hold down a modifier key to "lock" the document to the cursor; move the mouse, and the document scrolls with it.

Xkeys and FunKeys (http://www.zarkonnen.com/projects/xkeys.php and http://www.rampellsoft.com/, respectively): These utilities allow you to launch applications, and open files and folders, by pressing function keys. (Mac OS 9 provided such functionality, but it’s missing from Mac OS X.)

End Sidebar

You can edit application keyboard shortcuts using the same procedure described above for editing the built-in global shortcuts. However, before you change a shortcut for an application, you should quit that application. After changing the shortcut, you can then launch the application again.

If you’re having trouble with a particular keyboard shortcut, select it in the Keyboard Shortcuts tab and click the minus (–) button. If, for whatever reason, you want to get rid of all your custom shortcuts, click the Restore Defaults button to completely remove them all and restore the shortcuts list to its “out of the box” configuration.

Warning

The Restore Defaults buttons will delete all your custom shortcuts—immediately. You won’t even get the usual “Are you sure?” dialog that’s so common in OS X. So be sure you want to get rid of all of your custom shortcuts before you click this button. (Of course, this also means you should be extra careful not to accidentally click the button when mousing around in the Keyboard Shortcuts tab.)

Print & Fax

User Level | any or admin, depending on setting
Affects | individual user or computer
Terminal | no

The Print & Fax pane provides settings for printing and faxing in Mac OS X. I cover it in detail in Chapter 12.

Sound

User Level | any
Affects | individual user
Terminal | no

In the Sound Effects tab of the Sound preferences panel, you can change your alert sound, the alert volume, and the overall system volume. You can also turn interface sounds on or off (e.g., the sound OS X makes when you move a file to the Trash) and choose whether or not an alert beep is played when you press the up/down volume keys on your keyboard. Finally, you can choose to show a volume menu in the menu bar. The other two tabs, Output and Input, allow you to choose the device used for sound output and input, respectively; if you have only a single device for each, these two tabs aren’t of much use. As straightforward as these settings might seem, I’ve got a few ways to spice them up.

Tip

To quickly access the Sound pane of System Preferences, hold down the Option key and press one of the volume control keys on your PowerBook, iBook, or Apple Pro Keyboard. System Preferences will open to the Sound panel.

Note

The Volume menu extra lets you adjust your Mac’s volume from the menu bar, but if you want quick access to your audio input/output settings, you’ll want to grab the free menu extra SoundSource (http://www.rogueamoeba.com/freebies/).

Temporarily Silence the Keyboard Volume Keys

If you generally prefer to receive audible feedback when you change the volume using the keyboard, but there are times when you need such changes to be silent, check the box next to “Play feedback.” When you need quiet, hold down the shift key as you change the volume, and feedback will be temporarily silenced. Conversely, if you’ve disabled feedback, you can hold the shift key down when you press one of the volume keys to temporarily activate audible feedback.

Control the Alert Volume Using the Volume Control Menu

If you choose to show the volume menu in the menu bar, you may not realize that you can control both the overall volume and the alert volume with it. To control the overall system volume, simply select a volume level from the menu. To change the alert volume, hold down the option key when you click the volume menu; any change you make will apply only to the alert volume.

Add Additional Alert Sounds
User Level | normal or admin
Affects | individual user or all users
Terminal | no

If you get tired of the alert sounds available in the Sounds Effects tab of Sound preferences, you can actually add your own. The only requirements are that the sound file must be in AIFF format, and the name of the file must end in .aiff (.aif won’t do). You can download AIFF files from the Inter- net, or you can make your own using tools such as QuickTime Player (if you’ve upgraded to Quick- Time Pro) or the excellent freeware SoundHack (http://www.soundhack.com/). You can even convert other sound formats to AIFF using these tools.

Once you’ve got yourself some good AIFF files, if you’re an admin user, place them in /Library/ Sounds, where they’ll be available for all users. Both admin and non-admin users can instead put AIFF files inside ~/Library/Sounds, and they will only be available to that particular user. The next time you launch System Preferences the new sound files will be available in the Sound Effects window.

Change the “Volume Change” Sound
User Level | admin/root
Affects | all users
Terminal | no

When you change the volume on your Mac, PowerBook, or iBook using the keyboard volume keys, you get feedback in the form of a unique alert (it almost sounds like a bubble popping). If you’d rather use some other sound for this feedback (an AIFF sound, of course), it’s possible to change it. It’s not easy, but it’s possible. You can make such a move in Terminal fairly quickly, but in this case I prefer doing it using File Buddy (http://skytag.com/filebuddy/), an excellent file utility that, among its many features, lets you move files using familiar open/save dialogs.

  1. Launch File Buddy as root (using one of the procedures discussed in Chapter 1).

  2. Choose File Ø Move; first you’re going to save the original sound file for safekeeping.

  3. In the Choose Object (Open) dialog, navigate to /System/Library/LoginPlugins/BezelServices
    .loginPlugin/Contents/Resources    , and then select the file volume.aiff; click Open.

  4. In the subsequent dialog (“Move to…”), select the folder you’ll be using to store the original sound file, and click Move.

  5. Next you want to move your new sound into the above directory. In the Finder, rename your new AIFF sound file volume.aiff.

  6. In File Buddy, choose File Ø Move… again, and select your new volume.aiff file.

  7. Navigate to the destination folder (the long path in Step 3), and click Move to move the new sound file into its new home.

  8. Log out and then log back in. The new sound should now be fully functional.

Tip

If you’ve enabled root login as described in Chapter 1, you can simply log out and then log in as root to move the files described here. Just make sure you immediately log out and then back in using your regular account.

Enable the Visual Beep
User Level | any
Affects | individual user
Terminal | no

This technically isn’t a “sound” issue; in fact, it’s not even a setting located in Sound preferences. However, since it’s directly related to system alert sounds, I thought I should mention it here. There are plenty of times when you don’t want your computer to make noise (e.g., when you’re in a meeting or class); at these times you may use the mute button to suppress any such sounds. On the other hand, you may still want to be aware of system and application alerts (especially the ones that don’t come with a dialog box). You can find the solution to this dilemma in the Universal Access preference pane (discussed later in this chapter). In the Hearing tab, simply check the box next to “Flash the screen when an alert sound occurs.” Even when alert sounds are muted, you’ll still see the visual “flash” on the screen.

The Internet & Network Category in System Preferences

The Internet & Network category of preference panes provides the interface for all network- and Internetrelated settings, including Sharing and QuickTime. QuickTime actually seems like the kid who’s doing his own thing, but with Apple’s increased emphasis on Internet media (streaming video and audio) this was probably the most appropriate category in which to place it. Most of the panes in this category will be discussed in much more detail in later chapters, so I won’t say much about them here.

.Mac

User Level | any
Affects | individual user
Terminal | no

This preference pane provides .Mac-related settings. I discuss it in detail in Chapters 9 and 10.

Network

User Level | admin for most settings
Affects | all users
Terminal | no

I discuss network settings and the Network preference panel in Chapter 9.

QuickTime

User Level | any, if not limited by an admin
Affects | individual user
Terminal | no

Although the QuickTime panel of System Preferences has a number of settings, they’re actually much simpler than they appear at first. In fact, many of the settings are rather self-explanatory, so I’ll simply talk about those that aren’t. The Plug-In tab controls only the QuickTime plug-in, not any other QuickTime functionality; any changes you make here only affect the functionality of Web browsers that have the QuickTime plug-in installed (or, perhaps more accurately, browsers that support OS X’s Internet Plug-Ins folder). The MIME Settings… button lets you select which types of downloaded media files the QuickTime plug-in should handle for you.

The Connection tab lets you designate your connection speed, which optimizes QuickTime for that speed. A few words of advice: Don’t try to choose a setting faster than your actual connection; instead of speeding things up, it will actually slow down Internet media since your connection won’t be able to handle the increased amount of data, and the different data packet sizes, that QuickTime will attempt to down- load. In the same tab, you generally shouldn’t make any changes under Transport Setup… unless you know exactly what you’re doing or are told to do so by your network administrator.

The Music and Media Keys tabs are generally used only if you have installed alternate MIDI music synthesizer files or need to enter access keys for secured media. If you do either of these things, you’ll be told exactly how to configure them by your software/media documentation or an administrator.

Finally, the Update tab lets you check for new versions of third-party QuickTime add-ins or new versions of the QuickTime software itself. Click the Update Now… button to immediately check for new versions, or simply leave the “Check for updates automatically” setting enabled to have QuickTime watch for updates for you. (Note that in order to check for updates for both QuickTime software and third-party QuickTime add-ins, you’ll need to click the Update Now… button twice—once for each option.)

Tip

The functionality of QuickTime’s Update feature is independent of the Software Update preference pane (discussed later in this chapter and in Chapter 4).

Sharing

User Level | admin
Affects | all users
Terminal | no

I talk about Sharing preferences in various other chapters of the book. You use this panel to access settings for Rendezvous and Internet Sharing (Chapter 9), File Sharing and OS X’s built-in Web and FTP servers (Chapter 10), Remote Login and Apple Remote Desktop (Chapter 11), Printer Sharing (Chapter 12), and OS X’s built-in firewall (Chapter 13).

The System Category in System Preferences

Whereas the General panel is a hodgepodge of settings that don’t seem to go anywhere else, the System category is a bit of a hodgepodge of preference panes. Some of them (Accounts, Date & Time, Startup Disk, Software Update) are certainly “System-related” and affect all users, whereas others (Speech, Universal Access, Classic) provide user-level preferences that have little to do with the OS as a whole. However, since they aren’t really “personal” and they certainly aren’t related to hardware, Internet, or networking, I guess Apple figured that “System” is probably the best place to stick them.

Accounts

User Level | depends on the setting
Affects | individual users or computer
Terminal | no

I covered most of the Accounts preferences pane in detail in Chapter 1. The parts that I didn’t cover there will be discussed in other parts of the book. For example, I’ll talk about the Security tab in Chapter 13 when I cover system security, and I’ll cover the Startup Items tab in Chapter 3 when I cover Login/Startup Items. However, there’s one option I don’t mention anywhere else, and that’s the Address Book Card: Edit… button in the Password tab. If a user clicks this button, Address Book will open to their own Address Book contact so that they can edit it.

Classic

User Level | any, if not limited by an admin
Affects | individual user
Terminal | no

This preference panel provides the interface for Classic environment settings. I cover it, and much more related to Classic, in Chapter 9.

Date & Time

User Level | normal or admin, depending on the setting
Affects | individual user or computer
Terminal | no

The Date & Time preference pane really has two functions: (1) to allow an admin user to set the computer’s date and time (via the first two tabs); and (2) to allow individual users to control the menu bar clock/calendar (via the third tab).

If you’re an admin user, you can choose the time zone in the Time Zone tab by either choosing a city in the Closest City menu or by clicking in the general area of your location on the map. At the top of the Date & Time tab—yes, the tab has the same name as the overall preference panel—you can choose to synchronize your computer’s time with a network time server by enabling the “Set Date & Time automatically” option. Choose a network time server—preferably the closest one to you geographically—from the menu to the right. (Alternatively, if you know the address of a network time server, you can click in the network time server field and type the address in manually.) Also in the Date & Time tab are settings for the date and time. However, I mention them last because you can change settings here only if you have not chosen to set the date and time automatically using a network time server. If that’s the case, you can simply click today’s date in the calendar, and type the current time in the fields above the clock. (You can also select a field and use the up and down arrow buttons.) Click Save to save your changes, or click Revert to go back to the previous settings.

Tip

For a slightly more entertaining way to change the time, click the clock’s hour, minute, or second hand and drag it around the clock face.

The Clock tab provides options for showing the date and time in the menu bar, as well as an option to use Mac OS X’s built-in speech capabilities to “read” the time to you every hour, half-hour, or quarter-hour. However, I prefer to use a third-party clock, as explained in the next section.

A Better Date & Time

Although you can customize the menu bar clock using the Clock tab of Date & Time preferences, Mac OS X’s date/time functionality lacks a good calendar display. I’ve personally unchecked the “Show the date and time” option and taken the BYOC (bring your own calendar) approach. The freeware wClock (http://www.wolfware.com/wClock.html) provides not only a clock that can be customized to a much greater degree than OS X’s built-in menu bar clock (color, font, tool tips, etc.) but also a convenient calendar window accessed by clicking the date/time display in the menu bar. In addition, the commercial You Control (http://www.yousoftware.com/) includes a clock/calendar module that provides similar functionality to wClock but with a better calendar display (Figure 2.10).

Figure 2.10: You Control provides a convenient drop-down calendar.
Tip

If you’re satisfied with OS X’s built-in menu bar clock and just want a calendar you can access from the menu bar, you’ll like the free MenuCalendar (http://www.objectpark.net/mc.html).

Software Update

User Level | admin to install updates
Affects | computer
Terminal | no

The Software Update pane allows you to check, manually or automatically, for updated Mac OS X software. I discuss this panel extensively in Chapter 4.

Speech

User Level | any, if not limited by an admin
Affects | individual user
Terminal | no

This preference panel actually provides the settings for three different sets of independent services. They’re grouped together because of the common link of speech.

The Speech Recognition Tab

Speech recognition in Mac OS X is nowhere near perfect, but it’s at the least entertaining, and for some uses it can actually be quite effective. In the On/Off tab of the Speech Recognition tab (yes, the Speech pane has tabs within tabs), you can turn the feature on and off; if you use it often, you can choose to have it start up at login. The Helpful Tips… button is actually quite useful; give it a try. If you really want to see all the things you can do “out of the box” using speech recognition, click the Open Speakable Items Folder button for a list all the different possible commands, including commands for Mail and Internet Explorer. (I counted 73 different commands on my Power Mac.)

The Listening tab lets you choose when your computer will listen for commands and whether or not you have to call your computer by name (a name that you get to choose). I highly recommend clicking the Volume… button to calibrate your microphone—I couldn’t get my PowerBook to understand a thing until I discovered that the gain on the internal microphone was set much too high.

Finally, in the Commands tab you can choose to have your computer respond to all commands, or just certain categories. By selecting a command set and clicking the Configure button, you can configure options for that set. Doing this for the Global Speakable Items set provides the option to “Speak command names exactly as written”; I recommend keeping this option enabled. I once spoke a command that ended in “document” thinking that the PowerBook would know I wanted to open a document— it instead thought I had said, “Log me out.” The result wasn’t quite what I had intended.

The Default Voice Tab

Many applications support text-to-speech, meaning you can have your Mac read text from within the application. The only thing this tab does is let you select the voice used for such functionality and choose how fast it reads the text to you. (Click the Play button for a sample of your settings.)

The Spoken User Interface Tab

The Spoken User Interface functionality of OS X adds additional feedback options for alert dialogs and certain text. The Talking Alerts section provides options for your computer to read alert dialogs (warnings, error messages, etc.). The items in “Other spoken items,” on the other hand, are a bit broader. You can have your computer speak highlighted text (from within any application, including the Finder) by pressing a key combination, or you can simply have your Mac read aloud any dialog text if you hold the cursor over it for more than a second or two. However, my favorite feature is the ability to announce when an application requires your attention. I often have multiple applications running, and often they’re doing things in the background. Some applications will beep when they’re done with a task, but often I’m not even sure which application beeped at me. With this option selected, when I’m burning a CD in the background and it finishes, the computer gently interrupts me to tell me that Disk Utility requires my attention.

Startup Disk

User Level | admin
Affects | computer
Terminal | no

In the Startup Disk preference pane, admin users can select the startup volume, and even the specific OS X system or OS 9 System Folder on that volume, that will be used the next time the computer boots up. I talk more about this preference panel in Chapter 3 when I talk about startup and in Appendix B when I talk about multiple volumes.

Universal Access

User Level | any
Affects | individual user
Terminal | no

Designed for users with difficulties seeing, hearing, or using the keyboard/mouse, Universal Access provides special features that make computing more accessible under Mac OS X. However, even if you don’t have such difficulties, you may find some of these features to be useful.

The Seeing Tab

The Seeing tab provides two helpful features for those with various visual impairments. The first is zoom functionality, which allows you to zoom in on the part of the screen surrounding the mouse cursor. Once zoom mode is enabled, command+option++ (actually =, but + is more intuitive to remember) zooms in, and command+option+– zooms out; you can even move around the screen while zoomed. Thanks to OS X’s impressive graphics engine, most text and graphics look clear and legible even when enlarged. You can easily turn zooming on and off by pressing command+option+8. There are other zoom options available here, but it’s hard to describe the effects they have; the best thing to do is just experiment with them until you find the combination that is most effective for you.

The second visual enhancement available is to change the color table of your display(s). You can choose to switch to grayscale mode (this is actually the only way to get a grayscale display in Mac OS X), or you can invert the screen completely (Switch to White on Black), which some people find easier to read. You can also adjust the contrast of your screen using the “Enhance contrast” slider; if you don’t like the subtle “striping” effect of OS X’s Aqua interface, increasing the contrast slightly will reduce the stripes without affecting the rest of the interface too much.

Tip

You can invert the screen at any time by pressing control+option+command+8. Pressing these keys again will also change it back. If you like to read text white-on-black, this is a great way to quickly switch.

The Hearing Tab

When discussing the Sound preferences pane, I mentioned that you could flash the screen whenever a system alert occurs; this is where you change that setting. Even though I have perfect hearing, I still use this setting. Sometimes I have my PowerBook muted, or sometimes my speakers at home are turned off at night, so I find the “visual beep” very helpful. There’s also a link here (Adjust Volume…) to the volume control in Sound preferences.

The Keyboard Tab

If you have trouble pressing multiple keys at once (for example, pressing shift+x to get X, or command+S to save a document), you can enable sticky keys—any modifier key (control, shift, option, command) you press will be “held” until you press a non-modifier key (or until you press the modifier again, or the escape key to cancel). Each held modifier is displayed on the screen until you either use it in a keyboard combination or cancel it.

If you have trouble accidentally pressing keys, you can enable a delay (and choose the length of that delay) between pressing a key and when the key is accepted. This way, only keys you purposely hold down for longer than that delay will be accepted.

The Mouse Tab

For users who have trouble using a mouse or trackball, you can turn on Mouse Keys, which allows you to control the cursor with the keypad (see “Keys Used by Mouse Keys”). Together with full keyboard access (discussed earlier in this chapter when I covered Keyboard & Mouse preferences), you can control almost anything on your Mac using the keyboard. (In addition to being helpful for those with physical difficulties, this feature can also help you out if your mouse breaks!)

Other Settings

At the bottom of Universal Access preferences are two other settings. “Enabling access for assistive devices” allows other software or hardware to access the services provided by Universal Access whereas “Enable text-to-speech for Universal Access preferences” allows text-to-speech to work while accessing the Universal Access preferences pane itself.

On-Screen Keyboards

Unfortunately, at the time of this writing Mac OS X doesn’t provide an on-screen keyboard solution, a necessity for a good number of limited-mobility individuals. However, if you or someone you know is in need of such functionality, the commercial KeyStrokes (http://www.assistiveware.com/, Figure 2.11) and the shareware VirtualKeyboard (http://www.corallosoftware.com/) both provide it.

Click To expand
Figure 2.11: KeyStrokes provides an on- screen keyboard for accessibility.

The Other Category in System Preferences

At the bottom of the System Preferences window is another category called Other. If you’ve never installed any preference panes yourself, or installed any applications that included them, your Others group may be empty. (In fact, the Others category may not even appear.) However, the reason this category exists is that eventually you will install another preference pane, or several, and the Others category is where any preference pane that wasn’t installed by Mac OS X will be listed. The question then becomes “How do I install other preference panes?”

Installing Other Preference Panes

User Level | normal or admin
Affects | individual user or computer
Terminal | no
Start Sidebar
Keys Used by Mouse Keys

Apple provides Mouse Keys functionality, but they don’t tell you which keys to use for which function. Here’s the list of keys and their actions:

Press option five times: Turn Mouse Keys on/off

1–9 (up, down, left, right, diagonal): Move the cursor

5: Click the mouse button

0: Hold down the mouse button

. (period): Release the mouse button

In order to use Mouse Keys on a PowerBook or iBook, you need to use the Function (fn) key in combination with the overlaid numeric keypad on the keyboard (unless you’ve installed a function key modifier as described in the sidebar “Keyboard/Mouse/Trackpad Enhancements”). In addition, because the Sticky Keys function doesn’t work for the fn key, to enable full use of the overlaid numeric keypad without holding down the fn key, you need to press the num lock key (generally F6).

End Sidebar

There are many third-party preference panes available for Mac OS X, and they’re very easy to install. The folder /Library/PreferencePanes hosts panes available to all users, and ~/Library/ PreferencePanes is where individual users install panes for their own personal use. (The stock OS X preferences panes are located inside /System/Library/PreferencePanes, but you shouldn’t put any others there.) Every preference pane is actually a file package—with a name that ends in .prefPane to indicate its purpose—and simply placing it in the appropriate folder will make it fully functional the next time you launch the System Preferences application. However, you actually have three ways to get your preference pane into the appropriate folder. Once you’ve downloaded a new preference pane, use one of the following procedures to install it.

The first method for installing your third-party preference pane—manually moving the new preference pane to the appropriate folder—works in all versions of Mac OS X:

  1. Quit System Preferences if it’s currently running.

  2. Drop the preference pane into ~/Library/PreferencePanes for your own use. If you’re an admin user, you can instead place it in /Library/PreferencePanes if you want all users to be able to use it. (If the appropriate PreferencePanes folder doesn’t yet exist, you should create it using the Finder’s New Folder command—File Ø New Folder or shift+command+N.)

  3. Launch System Preferences, and the new pane should be listed in the Other category, ready for use (Figure 2.12).

    Figure 2.12: System Preferences’ Others, category after installing a new preference pane

The second method, which works in OS X 10.3 and later, is to launch System Preferences and then drag the new preference pane anywhere into the System Preferences window. You’ll be presented with a dialog (Figure 2.13) asking you whether you want to install the new panel “for this user only” (which installs it in ~/Library/PreferencePanes) or "for all users of this computer" (which installs it in /Library/PreferencePanes). The preference pane package will be copied (not moved) to the appropriate directory, and the new pane’s icon will immediately appear in the Other category in System Preferences.

Figure 2.13: System Preferences lets you decide at which level new preference panes are installed.

The third method, also available in OS X 10.3 and later, is to simply double-click the icon of the new preference pane package in the Finder. You’ll see the same dialog shown in Figure 2.13, after which the package will be copied to the appropriate folder. The only difference between this method and the previous method is that when you use this method to install a new pane, the new pane is also opened immediately.

Note

Some preference panes are distributed via installer applications; the installer simply places the pane in one of the PreferencePanes folders for you, usually after asking if you want it installed for everyone or just your own account.

Removing “Other” Preference Panes
User Level | normal or admin
Affects | individual user or computer
Terminal | no

If you ever decide that you no longer want or need the functionality of a third-party preference pane, you have two ways to remove/uninstall it. The first is to make sure the System Preferences application isn’t running and then manually open the appropriate PreferencePanes folder and drag the unwanted preference pane package out—to the Trash or, if you want to keep it around but not installed, to some other location on your hard drive. I personally keep a folder in my ~/Library directory called PreferencePanes (Disabled) that I use for preference panes that I don’t have installed but that I want to keep around.

The second method for removing a third-party preference pane is to open System Preferences and then control/right-click the unwanted preference pane icon; a contextual menu will appear that says Remove “panel name” Preference Pane, where panel name is the name of the preference pane. Choose this item in the menu, and the unwanted pane will be removed immediately.

Warning

You should remove/uninstall only preference panes located in /Library or ~/Library; you shouldn’t try to remove those located in /System/Library.

Finder Preferences

There are actually two other groups of system-related preferences in Mac OS X that aren’t located in the System Preferences application, both relating to the Finder: the Finder’s own preferences and View Options for windows.

Finder Preferences
User Level | any
Affects | individual user
Terminal | no

The Finder in Mac OS X is actually an application; as such, its preferences are accessed via Finder Ø Preferences, rather than from the System Preferences application (see “Application Preferences” for more information on accessing application preferences). Selecting this menu item brings up the Finder’s own settings dialog, which contains options related to how the Finder displays and accesses files. I cover these settings in detail in Chapter 5.

View Options
User Level | any
Affects | individual user
Terminal | no

Choosing View Ø Show View Options in the Finder will bring up the Finder’s view settings palette for the active Finder window (meaning the one in which you are currently working; if no open windows are active, the settings will apply to the Desktop). In this palette you can control the appearance of the active window (icon size, icon layout, window background, etc.); you can also choose to have your settings applied to all windows rather than just the active one. The options here are also covered thoroughly in Chapter 5.


Application Preferences

Most system-wide preferences can be accessed, and changed, from within the System Preferences application. However, individual applications generally have their own, application-specific, preference interfaces. Luckily, the way you go about viewing and customizing those settings is fairly consistent across applications.

How Do I Access Application Preferences?

In previous versions of the Mac OS you might find the preferences menu item for an application in the Edit menu, the File menu, the Help menu, or even the Apple Menu. In Mac OS X, Apple has designated the Application menu—so named because the menu’s name is always the name of the active/ frontmost application—as the standard location for accessing application preferences, and strongly encourages developers to place their application’s preferences menu item there.

This means that if you want to change the settings for an application that has a preferences dialog (not all applications do), you’ll almost always be able to do so by going to Application Ø Preferences (where Application is the name of the active application). Knowing this rule actually clears up a bit of confusion as to why the Finder’s preferences are in the Finder menu instead of in System Preferences. The Finder is actually an application, so by placing its settings dialog in the Finder menu, Apple is simply being consistent.

That being said, there’s one set of preferences that are not modified using an application’s preferences dialog, and that’s toolbar settings.

Customizing Application Toolbars

Most applications written specifically for Mac OS X, and some applications originally written for Mac OS 9 but converted for use with OS X (called Carbonized applications, after Mac OS X’s Carbon application environment), take advantage of OS X’s new custom toolbars. I’ll use Mac OS X’s Mail application as an example; you can launch Mail and follow along if you like. (Even if you don’t use Mail, you can still launch it just to play around with the toolbar.)

Change the Toolbar Display

User Level | any
Affects | individual user
Terminal | no

You may have changed a toolbar display once before, when I covered the System Preferences application. The good news is that the same trick works in any Mac OS X application that uses the Aqua toolbar. By holding down the command key and clicking the toolbar widget in the upper-right corner of the window, the toolbar display will rotate between different combinations of icons, text, and icon and text size. Choose the one you want, and the application will always use that setup. (In case there’s any confusion, your preference will only be used for Mail; you get to choose your preferred display for each application separately.)

Customize Toolbar Contents

User Level | any
Affects | individual user
Terminal | no

By default, the Mail toolbar has nine commands (Delete, Reply, Reply All, Forward, New/Com- pose, Mailboxes, Get Mail, Junk, and Search). These are the ones the developer (Apple, in this case) decided are probably the most useful to the average user. However, many more commands are available, and you don’t even have to keep the ones that are already there. Simply control/right-click anywhere in the toolbar, and you’ll get a contextual menu that provides you with direct access to the same toolbar display options mentioned in the previous section. However, it also allows you to immediately remove a toolbar item, and it gives you the option to Customize Toolbar. That’s the big one. (You can also access the Customize Toolbar command via View Ø Customize Toolbar…)

When you choose Customize Toolbar, a sheet will appear containing a whole bunch of other tool- bar items (Figure 2.14). Much like you did earlier in the chapter when you dragged your favorite preference panes to the System Preferences toolbar, you can simply drag an item from the item sheet to the toolbar to add it; it will become another button for you to use.

Click To expand
Figure 2.14: Customizing the Mail toolbar

You can remove items you don’t use much by dragging them from the toolbar into the item sheet, and you can rearrange items in the toolbar by dragging them left or right. If you decide you liked the toolbar better the way it was originally, just drag the default set, found at the bottom of the sheet, to the toolbar, and it will be as good as new. When you’re finished, click Done, and your newly customized toolbar is ready for use.

This friendly toolbar interface, consistent across most OS X–native applications, is a great feature of Mac OS X, and one that many users never realize is available. In fact, even the Finder has custom- izable toolbars, and I’ll spend some time in Chapter 5 explaining how to get the most out of them.


Working with Preference Files

Whenever you make a change to a setting, whether it’s a Mac OS X setting or an application-specific setting, that change is stored somewhere on your computer. Apart from a few system-level settings that are stored in your computer’s low-level memory, preference settings are stored in preference files. Each application or preference pane has its own preference file to store its own settings. Generally, the only way users interact with these preference files is via the System Preferences application and application-specific preference dialogs. However, there are times when it can be useful to access these files directly. In the next few sections, I’ll talk about why and how.

Where Are My Preferences?

Much like everything else in Mac OS X, there are several locations for preference files. User-specific preference files—those that affect only a particular user—are located in ~/Library/Preferences and are modifiable only by that user. System-wide preferences—those that affect all users—are located in /Library/Preferences and can be changed or edited only by an admin user. For example, the settings for your Mac’s firewall are located in the second folder, and only an admin user can use the Sharing pane of System Preferences to change, or manually edit the preference file itself.

In Chapter 1 I mentioned how Mac OS X’s file organization provides for flexibility in allowing each user to customize their own computing environment. The various locations of preference files is a prime example of this organization.

Edit Preference Files Directly

Although you can access most system- and application-specific settings via System Preferences or application preference dialogs, respectively, there are often other settings or options available in the OS or in a particular application for which there’s no interface provided. In older versions of the Mac OS, there was no easy way to access such features. However, in Mac OS X, Apple has encouraged developers to use a standard preference file format that uses plain text and a well-known language called Extensible Markup Language (XML). What this means for you is that it’s actually possible to open most preference files in a text editor such as OS X’s TextEdit or the commercial BBEdit (http://www.barebones.com/), make changes, save the file, and immediately see the changes in action. (When I say immediately, I really mean "the next time you launch the application," which is generally when you’ll see changes take effect.)

That being said, although it’s possible to edit a preference file directly, that doesn’t mean that most preference files are easy to understand when viewed in this manner. Luckily, there are some excellent applications that allow you to view and edit preference files using a clear and relatively comprehensible interface. If you performed the earlier procedure to add additional folders to Desktop & Screen Saver preferences’ list of Collections, you’ve already used one, Property List Editor. The other good one is the freeware PrefEdit (http://www.bresink.de/osx/PrefEdit.html), from the same guy who gave us TinkerTool. As an example of the power of these utilities, I’m going to show you how to turn off one of the Finder’s most annoying (in my humble opinion) features—zooming rectangles.

Warning

If a setting exists, but the developer hasn’t provided you with an easy way to access it, there’s often a good reason! Be sure you know what you’re doing before you edit any preference file, and be sure to make a backup copy of the file beforehand; that way, if you experience problems after making a change, you can revert to the backup copy.

Turn Off Zoom Rectangles by Editing Finder Preferences

User level | any
Affects | individual user
Terminal | no

When you open a window in OS X, you see a “zooming” rectangle that expands the window until it reaches its full size; the window also “zooms” down when you close it. Although this is a neat effect, after a while it starts to bug me a little bit—I just want my windows to open or close quickly and let me work. (Luckily the effect seems to be getting more and more subtle with each major version of Mac OS X, so it doesn’t bother me as much in 10.3 as it did in 10.2.) Unfortunately, the Finder preferences dialog doesn’t let me change this behavior. This is one of the hidden preferences I mentioned, and here’s how you change it using PrefEdit.

  1. Make a copy of the file ~/Library/Preferences/com.apple.finder.plist. This will be your backup copy of the Finder’s preference file.

  2. Launch PrefEdit. By default it shows all of the preference files in your personal Preferences folder on the left.

  3. In the list of preferences, select com.apple.finder. A list of all the settings contained in the file will appear in the middle column of the window.

  4. Since the setting doesn’t officially exist, you need to create it. In the Contents box, choose Logical from the “Type to add” pop-up menu. In the Key field, type ZoomRects. Click the Add button. You’ve just created the Zoom Rectangle setting in the Finder’s preference file. (Note: I happened to know what the setting was called; you can’t just make up names for them.)

  5. In the list of settings in the middle column, scroll down and select the new setting (ZoomRects). The value for that preference will show up in the column on the right, and a description of the preference, along with its contents (the setting), appear at the bottom of the window. Unless you’ve previously used another utility to change this setting, it should say Yes.

  6. In the Contents area, click No (Figure 2.15).

  7. Choose File Ø Update all values to save your changes.

Note that although you just created the ZoomRects setting, you could have also edited an existing setting by selecting it in the middle column and then changing its value.

Figure 2.15: Changing a Finder setting using PrefEdit

In order for the changes to take effect, you need to relaunch the Finder. You can log out and then back in, or you can force quit the Finder (by choosing Apple Menu Ø Force Quit… and then selecting Finder in the Force Quit Applications window, or by holding down the option key and control/ right-clicking the Finder icon in the Dock and then selecting Relaunch from the resulting Dock menu), which will automatically relaunch. Your Finder windows should now open quickly and smoothly without the zoom effect. (You could have changed this setting using TinkerTool, but that would have spoiled all the fun of this exercise.)

Tip

You can launch PrefEdit as root (as described in Chapter 1) and use it to edit system-level preferences in /Library/ Preferences.

Edit Preference Files via Terminal

User level | any or admin, depending on preference file
Affects | individual user or computer
Terminal | no

In addition to opening preference files in a text editor or an application such as PrefEdit or Property List Editor, it’s also possible to change some preference file settings via Terminal. I’m running out of room in this chapter, so I can’t really get into all the details—plus it’s probably not something you’ll use much, if at all, since there are so many other easier ways to edit preferences—but if you’re interested, the defaults command in Terminal allows you to both view and edit certain preferences. Type man defaults <RETURN> in Terminal for more information.

As a quick example of the defaults command in action, think back to earlier in this chapter when I showed you how to use TinkerTool to enable double scroll arrows at both ends of scroll bars. You can achieve the same result using the defaults command by launching Terminal and typing defaults write "Apple Global Domain" AppleScrollBarVariant DoubleBoth <RETURN>.

How Can a Preference Be Wrong? Troubleshooting Preference Files

Preference files are subject to the same risks as any other data stored on a hard drive. They can be deleted or changed accidentally, and they can sometimes, somehow, become corrupt and fail to work. Here are a few quick tips on how to keep your preference files working and how to keep the bad ones from causing you too much grief.

Back Up Your Preferences

I’ll talk a good deal more about backing up in Chapter 15, but suffice it to say that if you keep a safe and recent backup of your ~/Library/Preferences folder, you’ll always be prepared if something goes wrong with a preference file, or if you accidentally delete one or edit it in a way you regret and want the original back. You can simply quit the affected application, place the backup copy in your Preferences folder—replacing the "bad" one—and you’re good to go.

Moving Preference Files to Find Problems

If you’re having trouble with a particular application, the first thing to suspect is the preference file for that app. Quit the application, locate its preference file in ~/Library/Preferences (preference files generally have the name of the application in their name), and move the file to the Desktop. Relaunch the application and see if the problem is gone. If it is, the problem was most likely a bad preference file; a new one was created when you relaunched the app, so you can simply go to the application’s preferences dialog and set things up again. Or, if you had very complex settings that you don’t feel like re-entering, you can restore an older, working copy of the preference file from a backup.

If you can’t find the specific preference file for the offending application, or if you’re having more general system-wide problems, you can actually move your entire ~/Library/Preferences folder to the Desktop. Log out and back in; if the problem still exists, it wasn’t caused by a bad preference file. If the problem is gone, one of the files in your Preferences folder is the culprit. You’ll need to manually figure out which one it is. Move your Preferences folder back, and then start making educated guesses about which is the culprit. A good first step to take is to view your Preferences folder in List view, and then click the Date Modified column to sort by date. Concentrate on files that were changed recently, or modified close to the time you started having problems, since most likely the file that is causing the problems was changed around the same time your problems began.


Moving On...

Team LiB

Moving On…

Understanding settings and preference files is a valuable skill, especially as you perform some of the tips and tricks explained later in the book. You’ll find yourself working with preferences frequently, and even manually editing a few preference files before all is said and done.

Now that you’ve got most of your settings the way you want them, I’m going to talk about getting the most out of the startup and login processes. You’d be surprised how much you can do before you even start working.


Chapter 3: Subjugating Startup and Leveraging Login

(Or: Mastering the startup and login processes.)

Overview

You’ve most likely booted up your Mac many, many times. In fact, if you’ve been using OS X for a while, you may have even set up a few applications to launch at login. However, a lot more is going on during startup and login than you’re probably aware. The startup system is chosen, code is loaded, services are started, and the login process is executed. Like much of Mac OS X, each of these actions and processes can be customized. In this chapter, you’ll learn more about how the startup and login processes work, how to tailor them to your preferences and uses, and how to take advantage of special startup options.

Tip

Although I don’t specifically cover troubleshooting in this book, understanding the startup and login processes can help you solve many problems, especially those that occur during these processes.


The Boot Process

When your Mac starts up, you see the gray Apple startup screen, then the white Mac OS X window (called the boot panel) on a blue background, and then the login screen; after logging in, you finally see the familiar Mac OS Desktop. (If your Mac is set to auto-login, you never even see the login screen.) However, between the time you press the power button and the point at which you can actually start using your Mac, a lot of things go on in the background. Although it’s not vital for you to know these processes inside and out, knowing some background about them will be useful later in the chapter as I discuss ways to customize startup.

The following is a summary of what happens at startup, in the order the events occur:

BootROM is activated. The BootROM is firmware—a type of software “driver”—built into your Mac’s hardware. Its purpose is to initialize and test your computer’s hardware and to choose an operating system to boot into. Assuming you’ve chosen a Mac OS X volume to boot from, the process proceeds as described below. (Open Firmware, which I’ll talk about later in this chapter, is part of the BootROM.)

BootX runs. BootX is a utility that loads the core of Mac OS X (the kernel), as well as any kernel extensions (drivers that interact directly with the kernel to provide added functionality; these files are generally located in /System/Library/Extensions). You see the gray Apple image on the screen. BootX then loads the systems for data, input/output (I/O), and messaging (not "instant messaging," like iChat, but rather the ability for parts of the OS and applications to communicate with each other), and then it mounts the file system. At this point your computer is officially "booting" Mac OS X.

System initialization occurs. Officially called the BSN init process, system initialization does four things:

  • Checks for certain startup options such as single-user mode or CD booting (both discussed later in this chapter, in “Special Startup Options”)

  • Runs the system initialization scripts (located at /etc/rc.boot and /etc/rc)

  • Launches the loginwindow application, which is responsible for displaying the login window and managing user-level processes

  • Continues to run in the background, cleaning up system-level processes that terminate (end)

The final step of the /etc/rc script is to launch Mac OS X’s SystemStarter utility (located at /sbin/SystemStarter). This utility launches the various services that allow Mac OS X to function properly, as well as many services (from both Apple and third-party vendors) that provide additional, system-level functionality. If you’ve ever opened the Activity Monitor utility (Process Viewer in OS X 10.2 and earlier) and seen processes you didn’t recognize, SystemStarter is a big source of them. Most of the processes launched by SystemStarter are ones that don’t show up anywhere other than in Activity Monitor or in other utilities that reveal system-level processes.

Apple’s startup items are located in /System/Library/StartupItems; third-party vendors generally install their startup services in /Library/StartupItems. (You’re probably thinking, "Hey, there’s that multi-domain file organization I read about in Chapter 1!" If so, you’re absolutely correct.) Note that SystemStarter is a Unix utility that can’t be launched in the Finder; if you ever need to use it, you have to use Terminal to access it. I’ll actually talk a bit more about it later in this chapter.

Note

You can get all the gory details of the boot sequence from Apple’s official developer note on the topic: http://developer.apple.com/ documentation/MacOSX/Conceptual/BPSystemStartup/ Concepts/Boot-Process.html. In fact, if you scroll down to the section on that page called Bootstrap Daemons, you’ll find that with OS X 10.3, Apple has introduced a new type of system-wide "startup item" called bootstrap daemons. These daemons aren’t located in /Library/StartupItems and work a bit differently than the Startup Items included there.

If this all seems a bit complicated and geeky, don’t worry. It’s not necessary for you to understand it in order to use, and enjoy using, your Mac. However, later in the chapter I’ll provide a few cool tips that deal with the boot process; you’ll definitely have a better understanding of the “why” and “how” behind them after reading this section.

Now it’s time to talk about how to customize the startup process.


Choosing a Startup Volume or System

The most obvious way you can tailor the startup process to your needs is by choosing the boot volume and/or the copy of the Mac OS you want to use to boot your Mac. You can do this via System Preferences or by using various procedures during startup.

Note

In several places in the discussion that follows, I mention booting into Mac OS 9. On some newer Macs, this is no longer an option. However, the examples given are still useful because they emphasize options and choices that may exist when multiple bootable operating systems are present.

The Startup Disk System Preferences

User Level | admin
Affects | computer
Terminal | no

The Startup Disk pane of System Preferences is where you choose the volume, and the operating system on that volume, you want your Mac to boot into at startup. When you select this panel from within the System Preferences application, Mac OS X checks all mounted/connected volumes (including NetBoot servers) for viable operating systems. On the newest Macs, it looks for bootable versions of Mac OS X; on older Macs, it looks for both Mac OS X and Mac OS 9 System Folders. During this process you’ll see the spinning “working” indicator. When it has finished, you’ll be presented with a list of all versions of the Mac OS that your Mac can use as a startup system (Figure 3.1); select the OS you want to use. If you want to restart immediately, click the Restart… button. Otherwise, close System Preferences or switch to another preference pane. In either case, your change will be saved, and your new startup volume and OS will be used the next time you start up.

Figure 3.1: The Startup Disk pane of System Preferences

You’ll notice that in Figure 3.1, the volume JuniorX actually contains two operating systems that are available to boot into: Mac OS 9.2.2 and Mac OS X version 10.2.1. This illustrates how a single volume can contain multiple valid operating systems. I could also choose to boot into Mac OS X 10.3.1 from the volume Senior.

The final option, Network Startup, is visible but doesn’t list any version of the Mac OS because none is available for network booting right now. However, even if OS X isn’t able to find a bootable system on your network, it still lets you choose Network Startup as your “startup volume.” If you do so, the next time you restart your Mac, it will first search for a NetBoot server to start from; if it can’t find one, it will revert to the OS it most recently used.

Choosing a Boot Volume at Startup via the Keyboard

User Level | any, unless restricted by Open Firmware
Affects | computer
Terminal | no

In addition to using System Preferences, you actually have a few other ways to select a boot volume at startup, all accessible via the keyboard. Because the startup process is generally “unrestricted,” any user can make these changes unless you’ve elected to protect your Mac using Open Firmware Password Protection (discussed in Chapter 13).

Using Startup Manager

On recent-model Macs, holding down the option key at startup will bring up the Startup Manager utility. Your computer will search for all volumes that contain a bootable Mac OS (9 or X) system. The search can take a while, especially if you’re connected to a network, but when it has completed, you’ll be presented with a set of iconic buttons, one for each bootable volume (two are shown in Figure 3.2). If the button for a volume has a blue X on it, selecting that volume will boot your Mac into OS X; selecting a volume with a blue and white Mac OS “happy face” will boot your Mac into OS 9. After you select a volume, simply click the right-arrow button on the screen to continue the startup process. If you need to rescan for volumes (e.g., if you’ve subsequently attached an external hard drive or connected to a network), click the circular arrow.

Figure 3.2: The Startup Manager utility

I emphasized the term volume in the previous paragraph because unlike the Startup Disk pane of System Preferences, which allows you to select from multiple bootable operating systems on each volume, the Startup Manager utility only shows a single OS per volume—the one most recently used to boot up your Mac. In other words, if you have a volume that contains Mac OS X and Mac OS 9, and you most recently used that volume to boot into OS X, that volume will show up only once on the Startup Manager screen and will be selectable only as a Mac OS X boot volume. You can see this difference by comparing Figure 3.2 (Startup Manager) with Figure 3.1 (Startup Disk in System Preferences); the same computer was used in both examples. The volume JuniorX has two bootable systems, Mac OS X and Mac OS 9, but whereas both are selectable in Figure 3.1, only OS X is an option in Figure 3.2. (Note that the term volume means any hard drive, removable disk, or partition— see the Online Appendix for more information on volumes and partitions.)

Tip

Macs that can take advantage of the Startup Manager include all iBooks; PowerMac G4 models with AGP graphics slots (including the G4 Cube); PowerBooks with FireWire ports; iMacs with slot-loading CD drives; and any Macs produced after these models. On earlier Macs, the option key doesn’t invoke Startup Manager.

One other difference between using Startup Manager and System Preferences is that the volume you choose in Startup Manager is used as the boot volume only for that particular startup. The next time you restart/start up, the volume/system chosen in Startup Disk preferences will be used. In other words, Startup Disk settings in System Preferences remain until you change them; selections made in Startup Manager affect only the current startup.

Tip

If you access the Startup Manager utility at startup in order to choose a boot volume, you’ll notice that it often takes a long time before you can actually select a volume and click the continue button. This is because your Mac is searching for any connected network volumes that could be used to boot your Mac. You can sometimes stop this search by holding down the mouse button until you see the spinning cursor stop.

Tip

If you need to eject the CD/DVD drive from within Startup Manager (either to remove a disc or to insert one), press command+. (period) or the E key; if you then insert a disc with a bootable OS that you want to select as your startup volume, be sure to click the rescan button in Startup Manager to cause the disc to show up as an option.

Temporarily Booting from a CD or DVD

There are bound to be times when you want to boot from a CD or DVD that contains a bootable OS (a Mac OS installation CD, a disk utility CD, etc.). If your Mac is already up and running, you can simply insert the disc and use the Startup Disk pane of System Preferences to select it. However, if your Mac isn’t running or won’t start up because of some kind of problem—or if you don’t want to use System Preferences and make the selection “permanent”—you can force your Mac to boot directly from a CD/DVD at startup (and for just that particular startup). Simply place the CD/ DVD in the drive and then hold the C key down as your Mac starts up. If you need to eject the drive to insert the CD, hold down the eject key on your keyboard (F12 on non-Apple keyboards), or press the mouse button, until the drive opens.

Using the OS X Install CD or DVD

If for some reason you can’t boot up from the volume chosen in System Preferences, and you can’t get an alternate startup volume to “stick,” you can sometimes use the Mac OS X Install CD or DVD to change the startup volume. Use the procedure described in the previous section to boot from the Install disc, and then choose Change Startup Disk from the Installer menu. You’ll be able to select any volume with a valid operating system installed; choose a volume, and then click Restart to start up using that volume.

Booting from a NetBoot Image

If your network is on the same network as a NetBoot server, you can choose to boot from a NetBoot image by holding down the N key at startup (until you see the blue background screen). If a NetBoot image is found, your Mac will start up this particular time using the OS on that image, and the volume NetBoot HD will be mounted when you log in. If a NetBoot image isn’t found, your Mac will start up using the most recent startup volume.

Force Booting from the Internal Drive

If you had previously selected an alternate startup volume, and want to force your Mac to instead boot from its internal hard drive, simply hold the D key down at startup (until you see the blue background screen). This forces your Mac to use the OS installed on its internal hardware for the current startup. More specifically, it forces your Mac to use the OS installed on the first partition of the internal hard drive. (See the Online Appendix for more information on partitions and volumes.)

Force Booting from a Volume Other Than the Selected Startup Disk

Flipping the previous scenario around, if you had previously selected a boot volume in Startup Disk preferences but want to use a different volume for this particular startup, hold down command+ option+shift+delete until you see the blue login background appear. This forces your Mac to ignore the volume currently selected in the Startup Disk preference pane and instead use the next available bootable volume, such as a second partition on your internal hard drive, a second internal drive, or an external FireWire drive or external CD drive.

Setting a Startup Volume via Terminal

Although less convenient than many of the other methods provided here, you can also choose a startup volume using Terminal (or other command-line environments, such as single-user mode). Such a procedure can be quite helpful when connecting to a Mac remotely via SSH (as described in Chapter 11)— you can choose a different startup volume for the remote Mac and then restart it so that it boots from that volume. To boot into Mac OS X, type sudo bless -folder "/Volumes/volumename/System/ Library/CoreServices" <RETURN>. To boot into Mac OS 9, type sudo bless -folder9 "/Volumes/ volumename/System Folder" <RETURN>. (In both commands, volumename is the name of the volume on which the desired OS is installed.)

When OS X and OS 9 Are Installed Together

If you have a single volume containing both Mac OS X and Mac OS 9 (the default installation on many Macs), and your Mac is one that can boot into OS 9, there’s one other trick you can use, but it’s a very specific trick that works in only one specific circumstance. If you last booted into OS 9, but at the next startup you want to instead boot into OS X on the same volume, you can hold the X key down at startup; this boots you into OS X and changes the Startup Disk preference to Mac OS X on that volume. You can’t press the 9 key to do the opposite, and this trick doesn’t let you change boot volumes; it doesn’t do anything else at all. But if you need to boot into Mac OS X in these particular circumstances, it’s a handy tool.

Note

As you read the different options for choosing a startup system, you may have noticed that if you have only a single volume, and you have both OS X and OS 9 installed on that volume (or you have two copies of OS X or OS 9), it’s a bit tricky to switch between them without starting up your Mac and then using System Preferences to select the desired OS. This situation is one where partitioning your hard drive comes in handy, as each partition is considered a different volume, allowing you to install a different OS on each. I’ll talk more about partitioning in the Online Appendix.


Customizing the Boot Panel

Once you’ve chosen a startup volume/system and started up your Mac, the computer begins booting and the boot panel appears. The boot panel is the subtly striped, white and gray box with the metallic silver Apple logo that appears at startup; you see it in between the initial gray Apple screen and the login screen. (In OS X 10.2, it’s a white and gray striped box with a blue Apple logo.) As it’s displayed, you also see text—called the boot strings—that indicates the various system services that are being loaded. After a while, the boot panel can get pretty boring, and many users would rather have a screen that illustrates their individuality. (These are the same people who changed their startup screen under OS 9.) It turns out that you can change the image used for the boot panel. The process isn’t trivial, but it’s certainly doable for a determined user.

Changing the Boot Panel Image

User Level | admin
Affects | computer
Terminal | yes (unless a third-party utility is used)

You can change the boot panel image manually or using one of several third-party utilities; I’ll focus on the manual method here, as it provides some insight into how OS X’s system graphics are stored. But before you change the boot panel image, you need to find or make a replacement image. If you’re the creative type, you can make your own in any photo or graphics application. The size of the image should be approximately 350 pixels wide by 265 pixels high (and you should make sure that you leave room—some blank space—in the bottom half of your image for the progress bar and boot strings). Your new image should be in PDF format. (If your graphics application can’t save files in PDF format, you can use OS X’s Preview application to convert your image to PDF.) Or, if you want to take advantage of one of the many replacement boot panels already out there, visit http://www.resexcellence.com/user_X_boot.shtml. Once you’ve got your new boot panel image, it’s time to install it.

Note

Changing the boot panel changes it only for the specific Mac OS X volume on which you make the change. If you have multiple Mac OS X startup volumes, and you want a custom boot panel on each of them, you’ll need to follow the procedures below for each volume.

The default boot panel image is located at /System/Library/CoreServices/SystemStarter/
QuartzDisplay.bundle/Resources/BootPanel.pdf. (Because QuartzDisplay.bundle is actually a package file, in order to view the Resources folder you’ll need to right/control-click the QuartzDisplay.bundle "file" (or select it in a Finder window and click the Action menu item in the toolbar) and then select Show Package Contents from the resulting contextual menu.) In order to replace the BootPanel.pdf file with your new boot panel image, you’ll need to use sudo in Terminal or launch a file utility, such as File Buddy, as root (as discussed in Chapter 1). I’m going to use Terminal in the example steps below, but you can use File Buddy to copy and move files as I showed you in Chapter 2.

  1. Rename your new boot panel image BootPanel.pdf.

  2. Launch Terminal, and then back up the default boot panel image to your Desktop:

    cp /System/Library/CoreServices/SystemStarter/QuartzDisplay.bundle
Ä/Resources/BootPanel.pdf ~/Desktop/BootPanelBackup.pdf <RETURN>

    (There are only two spaces in that line: one after cp and one between the first .pdf and ~.)

  3. Using the path to your new boot panel image, move it to the location of the original image; since the location to which you’re copying it is located in /System, you need to use the sudo command:

    sudo mv NewImagePath /System/Library/CoreServices/SystemStarter
Ä/QuartzDisplay.bundle/Resources/BootPanel.pdf <RETURN>

    (There are three spaces in that line: after sudo, after cp, and after NewImagePath.)

    You’ll be asked for your account password for the copy to proceed. The command will automatically replace the original BootPanel.pdf file (which is why you made a backup in Step 1).

  4. Restart your Mac to see the new boot panel image (see the example in Figure 3.3).

    Click To expand
    Figure 3.3: The default (left) boot panel image and a custom image (right)

Tip

The shareware preference pane Visage (http://www.stanford.edu/~keaka/) provides a graphical interface that makes changing the boot panel very simple. (It also lets you change a number of other boot and login aesthetics.) Unfortunately, at the time of this writing it’s not 100 percent compatible with Mac OS X 10.3 or later. However, the developer has promised an updated version, so you may want to check the website to see if it’s available. (The previous version of Mac OS X Power Tools included a number of sections on using Visage. If a Panther-compatible version of Visage is released, I’ll revise these sections and make them available on the book’s website, http://www.macosxpowertools.com/.)

Warning

In addition to modifying the boot panel, it’s possible to customize the boot image, the gray Apple logo on a gray background that you see immediately after pressing the power button (before you see the boot panel). However, to do this you must actually modify the BootX utility described at the beginning of this chapter. I don’t recommend doing this, as any mistake or file corruption could render your Mac dead in the water, necessitating a full reinstall of Mac OS X. However, if you’re feeling brave and want to try this on your own, I recommend the free utility Startup Syringe (http://www.ryandesign.com/syringe/), which automates the process for you and, if you so desire, even provides the old Happy Mac image from earlier versions of the Mac OS. A good collection of boot images is available at http://www.resexcellence.com/bootimage/.

Reverting to the Original Boot Panel Image

User Level | admin
Affects | computer
Terminal | yes (unless a third-party utility is used)

If you ever get tired of your new boot panel image and decide that you want the original back, here are the steps to take:

  1. If you want to keep your “new” boot panel image around, you need to back it up. To copy it to your Desktop, launch Terminal and then type the following:

    cp /System/Library/CoreServices/SystemStarter/QuartzDisplay.bundle
Ä/Resources/BootPanel.pdf ~/Desktop/NewBootPanel.pdf <RETURN>

    (There are only two spaces in that line: one after cp and one between the first .pdf and ~.)

  2. Assuming that your original boot panel image is on your Desktop and is named BootPanelBackup.pdf, type the following command to move the original file from your Desktop to its appropriate location:

    sudo mv ~/Desktop/BootPanelBackup.pdf/System/Library/CoreServices/SystemStarter
Ä/QuartzDisplay.bundle/Resources/BootPanel.pdf <RETURN>

    (There are three spaces in that line: after sudo, after mv, and after BootPanelBackup.pdf.)

    You’ll be asked for your account password for the move to proceed. The original file will automatically replace the “new” one inside the QuartzDisplay.bundle package.

  3. Restart your Mac, and your original boot panel image will be shown at startup.


The Login Process

Once the boot process is complete, the Mac OS X login screen appears (assuming that you don’t have your account set to auto-login, as described below). The login window is where users log in by selecting an account and then entering the password for that account. Although the login screen and window look rather simple, you can customize them in a number of ways.

In addition, although I discussed creating accounts in Chapter 1, and I talked about configuring some of the settings in the Accounts pane of System Preferences in Chapters 1 and 2, I haven’t yet covered the Accounts pane’s login-related settings: the Login Options screen and the Startup Items tab.

Login Options in Accounts Preferences

User Level | admin
Affects | computer
Terminal | no

If you launch System Preferences and click the Accounts pane, you’ll see the familiar account setup options I discussed in Chapter 1; however, if you click the Login Options button in the lower left you get a few extra options that I haven’t yet discussed; all of these options require admin access.

Display Login Window as The first option is to display the login window as either “List of users” or “Name and password.” If you choose to display the login window as a list of users, each user’s username and custom picture (if one has been chosen, as discussed in Chapter 1) will be displayed. Clicking a username/picture will select that account and present a password box to log in as that user. (You can also select a user by typing the first few letters of the username; once the username/picture is highlighted, press return to select it.)

If you instead choose to view the login window as “Name and password,” you’ll simply be provided with two blank fields: one for account username and one for account password. Users will have to provide both in order to log in (they can use either their short username or long username).

The advantage to using the “List of users” option is that it’s easier and more convenient for users to log in. The disadvantage is that if your computer is publicly accessible, showing user accounts at startup means that a malicious user already has half of what they need in order to gain access to your computer—the username—and they only need to figure out a password. I personally show the list of users on my home computer but use the “Name and password” setting on my laptop.

Automatically log in as If you enable this option and then choose a user from the pop-up menu to the right, you’re presented with a dialog that asks you for the user’s password. If you provide it correctly, that user’s account will be set to log in automatically at startup, without showing the login window and without requiring a password; in effect, it’s as if that user was the only user of the computer. (This is a popular option for home users who are moving to OS X from OS 9.) The downside to this option—besides the lack of security—is that if you want to set an account other than your own to auto-login, you need to know that account’s password. (Although if you’re an administrator, you could always change the user’s password yourself and then enter the new password here.) (If you’re using Mac OS X 10.2, the auto-login option is located in the Users tab of Accounts preferences.)

Tip

To temporarily override the auto-login option at startup (e.g., to allow another user to log in), hold down the shift key when the boot panel (the white box with the Apple logo) appears. Release the shift key when the login window appears.

Note

At the time of this writing, there’s also an option in the Security pane of System Preferences (discussed in detail in Chapter 13) to “Disable automatic login” for all accounts. Why Apple has let you enable auto-login in one preference pane and disable it in another is beyond my abilities to explain (not to mention the lack of logic in having you enable the feature in a “System”-level preference pane, but allowing you to prevent it in a “Personal”-level pane). I hope this discrepancy will be fixed in a future update.

Start Sidebar
Panther vs. Jaguar: Login Password Hint Options

The Accounts preference pane in OS X 10.2 (Jaguar) provides one additional login option: “Show Password Hint after Three Attempts to Enter a Password.” With this option enabled, if a user tries to log in and provides the wrong password three times, the password hint set up in the user’s account settings (if provided) will be shown on-screen. This can be a helpful feature; however, if your Mac is at risk of someone trying to gain access, keep in mind that hints help not just you and your legitimate users; they also help the hacker. So being able to disable these hints, especially on a laptop or a computer in an unsecured location, is a nice feature.

OS X 10.3 (Panther) also has such functionality; however, it’s enabled/disabled for each account individually. In theory, if you provide a password hint for your account (in the Password tab of Accounts preferences), the feature is enabled; if you don’t provide a hint, it’s disabled. (I say in theory because at the time of this writing, if you’ve ever had a password hint but then deleted it, the hint dialog will still appear after three incorrect password guesses—as described in “If a User Forgets Their Password,” below—but the “hint” will be blank. This behavior is technically still “secure” since no hint is provided, but it’s a bug, nonetheless—deleting your password hint is supposed to disable the hint feature. Perhaps by the time you read this Apple will have fixed this bug via an OS X update.)

The problem I have with OS X 10.3’s approach to password hints is that control of the hint feature is taken away from the administrator and placed in the hands of each user, individually. By providing a password hint for their account, they’re in effect enabling hints, even if you, as an administrator of your Mac, don’t want them enabled.

That being said, just because there’s no simple way to disable password hints for all accounts in OS X 10.3 doesn’t mean you can’t do it. Here’s how:

  1. Open a text editor, such as TextEdit or BBEdit, as root, as described in Chapter 1.

  2. Open the file /Library/Preferences/com.apple.loginwindow.plist in the text editor.

  3. Find the line that says <key>RetriesUntilHint</key>.

  4. Just below that line is a line that says <integer>3</integer>. Change the 3 to 0.

  5. Save your changes.

The next time a user logs in, password hints will be disabled. If you ever want to turn them on again, you can edit the same file, replacing 0 with 3 (or any other number of "incorrect tries" you prefer). Alternatively, you can log in using an admin account and then change the password hint for any user in Accounts preferences (or provide a password hint if the field is empty). After you do this, when you try to switch to another Accounts panel or another user’s settings, or if you try to exit Accounts preferences, you’ll get an error message that reads, "Password hints are currently turned off for this computer. Would you like to turn them on?" (You’ll also get an erroneous message that states that you can enable them by opening the Login Options screen.) Simply click the Enable button, and password hints will be reset to their default state—on, and appearing after three incorrect login attempts.

End Sidebar
Start Sidebar
If a User Forgets Their Password

If a user forgets their password and can no longer log in, you have two options. If password hints are disabled, you (or another admin user) must log in to your own account and then change the user’s password from Accounts preferences. Afterward you can give the new password to the user so that they can log in. (They’ll be able to change the password, if they want a different one, via Accounts preferences—just remind them not to forget it again!)

If password hints are enabled, you have another option—one that doesn’t require an admin user to actually log in to their own account. (It still requires an admin user, but only to authenticate the procedure.) However, this option requires a bit of forethought: You need to enable a master password for your computer before a user forgets their password. You (or any other admin user) can do this from the Security tab of Accounts preferences; simply click the Set… button. (If a master password has already been set, the button will read Change…, in which case, assuming you know the master password, you can skip this step.)

When a master password is set and password hints are enabled, if a user tries to log in incorrectly three times, the login window will show their password hint, along with a button that says Reset password… An admin user can click this button, provide the master password, and then click the Continue button. The login window will then allow the admin—or the user, if they’re present—to provide a new password and password hint. (Note that changing the account password also creates a new Keychain file for the account, as explained in Chapter 13.)

End Sidebar

Hide the Sleep, Restart, and Shut Down buttons The third option is to “Hide the Sleep,

Restart, and Shut Down buttons.” Having these options available at login is convenient in a secure environment, such as your home. However, since you can easily choose a startup volume using the keyboard—as I discussed earlier in this chapter—a malicious user could click the Restart button and then boot your Mac from an OS 9 volume, from a different OS X volume, or from a system install CD and then change passwords or even wipe out your hard drive. Thus, on a laptop or publicly accessible computer, you may want to disable these buttons.

Enable Fast User Switching This option enables the Fast User Switching option, which I covered in detail in Chapter 1.

Other Login Window Options

Although Mac OS X provides a number of login window options via System Preferences, you may be interested in a few other options that can’t be accessed in this manner. You can easily modify many using third-party software; a few others require a bit of work in NetInfo Manager.

Using LoginWindow Manager to Modify “Hidden” Login Window Options

User Level | admin
Affects | computer
Terminal | no

Like many “hidden” preferences in OS X, the login window’s hidden options are accessible by manually editing its preference file, /Library/Preferences/com.apple.loginwindow.plist; however, doing so requires that you know exactly what to change. The free utility LoginWindow Manager (http://www.bom-bich.com/software/lwm.html) provides a simple graphical interface for these options (Figure 3.4). When you launch LoginWindow Manager, you’ll be asked for your admin-level account password. After providing it, you can enable or disable any of the settings. When you’re finished, click the Apply button. (Note that although some settings take effect immediately, some don’t take effect until you restart your Mac.)

Figure 3.4: LoginWindow Manager lets you access hidden login window options.

A few of the settings in LoginWindow Manager are duplicated in System Preferences; those not normally accessible are explained below:

Hide local users in the list of users to select from This option causes the login window to show name and password fields, even if you’ve selected the “Display Login Window as List of users” setting in the Login Option screen of Accounts preferences.

Hide admin users in the list of users to select from If you’ve selected the “Display Login Window as List of users” setting in the Login Options screen of Accounts preferences, this option prevents admin users from appearing in the list. Note that if Fast User Switching is enabled, any admin users currently logged in will still appear in the list, even if this option is enabled.

Include network users in the list of users to select from If you’re running a network using Managed Client for X (MCX), this option will include network users in the list of users (assuming you’ve selected the “Display Login Window as List of users” setting in Accounts preferences).

Show the “Other…” user When viewing the login window as a list of users, this option adds the “Other…” user. (Normally, Other… is visible only if the root user is enabled.) When Other… is clicked, the display changes from a list of users to the name and password fields, allowing you to log in as a user not shown in the list of users. If you’ve chosen to hide local users or admin users from the list of users, this is the only way for those users to actually log in—they need to click the Other… button and then type their username and password.

Tip

If the option to show the Other… user is disabled, hidden users can still log in by pressing option+return and then clicking any user in the list of users; the name/password dialog will appear. You can also force the Other… option to appear in the login window at startup, or when choosing Login Window… from the Fast User Switching menu, by holding down shift+option before the login window appears.

Disable Apple menu logout/restart/shutdown (kiosk) With this option enabled, the Restart, Shut Down, and Log Out items in the Apple Menu are disabled. It also disables keyboard equivalents, such as the power key (which normally brings up a dialog with options to Restart, Sleep, Cancel, or Shut Down) and shift+command+Q (to log out). This option can be useful for Macs that are used as “kiosks”—public computers that you don’t want shut down or logged out. Note that this setting requires a restart to take effect.

Disable “>console” login feature When enabled, this option prevents console login, discussed later in this chapter (in “Accessing ‘Terminal’ at Login: Console Login”).

Login/Logout Hooks This option allows you to designate shell scripts (discussed in Chapter 15) to be run at login and/or at logout. Simply enable the login or logout option, and then enter the path to the script in the appropriate field. For example, you could create a shell script that mutes your Mac’s sound at logout, thus disabling the loud chime the next time you start up. Note that scripts must be standard shell scripts, and they must be written a particular way. For more details, and some example scripts, visit the LoginWindow Manager URL, provided above.

Preventing Certain Users from Appearing in the List of Users

User Level | admin
Affects | particular users
Terminal | yes

Although LoginWindow Manager provides access to options for hiding certain users, these options are general—they prevent all local users from appearing or prevent all admin users from appearing. What if you want to prevent certain user accounts from being listed but want the rest to show up normally?

To do this requires a bit of work in NetInfo Manager, which I covered in Chapter 1. Basically, any user account with a user ID (UID) below 500 will not show up in the list of users in the login window. Here’s how to change a UID:

  1. Launch NetInfo Manager, and then authenticate by clicking the padlock icon. (Remember what I said in Chapter 1 about backing up your NetInfo database before working with it.)

  2. In the “/" column at the top of the NetInfo Manager window, select users.

  3. In the users column, select the short username of the account you want to hide in the login window’s list of users.

  4. In the Property/Value(s) panel, find the uid property. Double-click its value (which will most likely be 501 or higher) to edit it.

  5. Enter a value of 499 or lower. (Be sure that whatever new UID you provide isn’t already being used by another user account; most numbers in the 400–499 range should be fine.)

  6. Choose Domain Save Ø Changes.

  7. You’ll also need to update the ownership of any files and folders created by this user so that the user can access them after the UID change. To do so, launch Terminal and type the following command: sudo find / -user olduid -print0 | xargs -0 sudo chown newuid <RETURN>, where olduid and newuid are the user’s old and new UIDs, respectively.

The next time you view the list of users in the login window, the account will not be visible. The user can still log in using that account; they just need to access the name/password dialog (via the Other… button, or by pressing option+return and then clicking any visible user) and then enter the account username and password.

Note

Users with a UID below 500 also don’t show up in the Fast User Switching menu. To log in to one of these accounts, you need to choose Login Window… from the Fast User Switching menu and then provide the account name and password.

Disabling Login for Certain Accounts

User Level | admin
Affects | particular user
Terminal | no

What if instead of hiding a particular user account, you want to disable it? That is, what if you don’t want to delete the account outright, but rather want to prevent anyone from being able to log in to it? Doing so requires another trip to NetInfo Manager. However, the procedure differs depending on the type of password authentication being used. You don’t need to understand all the details, but the gist is that accounts created under Mac OS X 10.3, or that have had their password updated under OS X 10.3, use a different type of password authentication than those created under OS X 10.2 or earlier that haven’t yet had their password updated under OS X 10.3. The instructions below explain how to disable both types of accounts:

  1. Launch NetInfo Manager, and authenticate by clicking the padlock icon. (Remember what I said in Chapter 1 about backing up your NetInfo database before working with it.)

  2. In the “/" column at the top of the NetInfo Manager window, select users.

  3. In the users column, select the short username of the user account you want to disable.

  4. In the Property/Value(s) panel, find the property called authentication_authority.

    1. If the authentication_authority value is ;ShadowHash;, double-click the value to change it to ;DisabledAccount;.

    2. If the authentication_authority value is ;basic;, leave it alone and instead edit the value of the passwd property. Place an asterisk (*) at the beginning of the passwd value.

  5. Choose Domain Ø Save Changes to save your changes.

The account is now disabled. To re-enable it, reverse the procedure listed above—either change the authentication_authority value back to ;ShadowHash; or remove the asterisk from the beginning of the passwd value.

The Startup Items Tab of Accounts Preferences (Which Should Still Be Called Login Items)

User Level | any
Affects | individual user
Terminal | no

Whereas the Login Options screen of Accounts preferences provides system-level login options, each user has their own Startup Items tab within Accounts preferences, which, despite the name, actually controls login options—two to be exact. The first option is the ability to have items (applications, folders, files) opened automatically when the user logs in. The second option allows you to have applications that launch in this manner hide automatically, so as not to clutter the screen.

Note

Don’t confuse OS X 10.3’s user-level Startup Items (which open at login and are listed in the Startup Items tab of Accounts preferences) with system-level Startup Items (discussed later in this chapter; these actually run at startup). Because of their similar names, throughout Mac OS X Power Tools, I’ve tried make clear which Startup Items I’m talking about by calling user-level Startup Items “Login/Startup Items,” to borrow from their more accurate name in OS X 10.2 and earlier. (See the sidebar “Panther vs. Jaguar: Login Items vs. Startup Items.”)

To have an item open automatically at login, select your account in Accounts preferences, click the Startup Items tab, and then drag the item into the list that appears; alternatively, click the plus (+) button just below the list of items, and then navigate to the desired item in the resulting file browser (Figure 3.5). To automatically hide an application after it launches at login, check the Hide checkbox to the left of the item’s name (the Hide checkbox has no effect on documents or folders). The next time you log in, the items listed in the Startup Items tab will be launched or opened as soon as the Finder appears. To remove an item (thus preventing it from launching at login), select it in the list and then click the minus (–) button (or press the delete key on the keyboard).

Figure 3.5: Using the Startup Items tab to automatically open frequently used items at login

Login/Startup Items are actually a very useful feature, as you can log in and have your favorite applications waiting for you to use when login is complete. You can also open documents, or even folders, that you tend to access frequently. (In Chapter 12, I’ll even show you how to use these user- level Login/Startup Items to automatically connect to servers at login.)

You can also change the order that items are opened by dragging them up or down in the Startup Items window; for example, some applications prefer to be opened earlier or later than other items, or perhaps you want to open a certain spreadsheet before you open other documents that link to it.

Note

You may notice a few Startup Items that you didn’t set up yourself. This is normal; some Mac OS X applications require background processes in order to function properly and use the Startup Items feature to start those processes. In addition, some applications will ask you if you want them to run at login; if you say “yes,” you’re basically giving them permission to add themselves to the Startup Items list. If an item appears in your Startup Items list and you didn’t put it there, be sure you know what it does before you remove it.

Figuring Out Where a Login/Startup Item Came From

If you see an item in your Startup Items list with a blank icon, this usually means that the item is no longer on your hard drive or has been moved to a different volume—i.e., it can’t be found. It’s usually safe to remove the item from the list. However, sometimes it’s something you know you need opened at login, so you want to find it on your hard drive and re-add it to the list. On the other hand, sometimes you may find an item in your Startup Items list that’s not blank, but you don’t recognize it, and you wonder if you can remove it. In either scenario, locating the item on your hard drive—or where it should be on your hard drive—can often help you figure out its purpose and why it has been added. (As mentioned above, some items are added by other applications.)

In OS X 10.3 or later, finding an item’s location is quite simple: move the mouse cursor over the item in the Startup Items list; after a second or so a “tooltip” window will pop up showing the path to the item.

If you’re running OS X 10.2 or earlier, it’s a bit more work. Open the file ~/Library/Preferences/
loginwindow.plist in your favorite text editor, and then do a search/find for the name of the item. Alternatively, if you’ve installed the OS X Developer Tools, you can instead open the same loginwindow.plist file in Property List Editor; Login/Startup Items are listed in the AutoLaunchedApplicationDictionary section. In either case, each Login/Startup Item in the file has a Path property that shows the path to the item on your hard drive. For example, I have an item called SetiChatStatus in my Startup Items; if I open the above file and search for that item, I learn that it’s located at ~/Library/PreferencePanes/iChatStatus.prefPane/Contents/Resources/
SetiChatStatus.app, meaning that it was added to my Login/Startup Items by the third-party preference pane iChatStatus.

If you used Mac OS 9 before moving to OS X, Login/Startup Items probably remind you of OS 9’s startup items. They’re very similar, with the exception being that in OS 9 there was a single Startup Items folder and items inside that folder were indeed opened at startup, whereas in OS X each user has their own list of Login/Startup Items that open only when that user logs in. If you prefer the OS 9 way (adding files to the Startup Items folder), you can actually use that method if you prefer; that’s the next tip.

Start Sidebar
Panther vs. Jaguar: Login Items vs. Startup Items

In OS X 10.2 (Jaguar), the functionality of OS X 10.3’s (Panther’s) Startup Items tab is found in a separate preference pane called Login Items. Just as you add items to the list of Startup Items in Panther, in Jaguar you add items to the list of Login Items. However, whereas Accounts preferences are located in the System Preferences’ System category, the Login Items pane in Jaguar is located in the Personal category. For all the things I like about Panther, this is one change that really irks me, both in its terminology and its placement. (Who knows, maybe by the time you read this, Apple will have changed things back to the “way of the Jaguar.”)

The reasons I dislike this change are as follows: (1) Panther’s Startup Items open at login, not startup, so the term Startup Items is inaccurate. (2) Mac OS X already has items called Startup Items, located in /System/ Library/StartupItems (and possibly in /Library/StartupItems, if third-party software has installed them there)—I discuss these items later in this chapter, but for now I’ll just note they really do open at startup, before any user logs in. These overlapping names are confusing to users. (3) Finally, placing OS X 10.3’s user-level Startup Items settings in the Accounts pane of System Preferences—which is listed in the System category of System Preferences, as explained in Chapter 2—is also confusing. OS X 10.2’s approach—locating them in the Personal category—makes more sense, in my opinion.

End Sidebar

Using OS 9–Style “Startup Items” Instead of OS X Startup Items

User Level | normal
Affects | individual user
Terminal | no

Under Mac OS 9, if you wanted items to be launched at startup, you placed them, or aliases to them, in the Startup Items folder inside the System Folder. If you prefer this approach to Mac OS X’s version of Startup Items, you should download the shareware Panther Cache Cleaner from Northern Softworks (http://www.northernsoftworks.com/). In Panther Cache Cleaner, click the Login Items tab and check the box next to Use Login Items Folder. This will create a Login Items folder in your home directory. You can treat this folder just as you would an OS 9 Startup Items folder— drag items in or out as you desire; anything inside will be opened at login. (Yes, at login, not at startup—after all, these are user-level settings.) Note that an item called Login Items Engine will add itself to OS X’s list of Login/Startup Items in System Preferences; you should leave it there for this feature to work properly.

Tip

If you’d like to have a sound or movie played at login, check out Login Sounder (http://homepage.mac.com/torgo/) or inCinema (http://www.versiontracker.com/dyn/moreinfo/macosx/17839), respectively.

Customizing the Login Screen

Earlier in this chapter I showed you how to customize the boot panel; you also have a few options for changing the login screen, the easiest of which are changing the appearance of the login background and adding text to the login window itself.

Changing the Login Background

User Level | admin
Affects | all users
Terminal | no

By default, the login background (the screen you see behind the login window) is Apple’s classic “Aqua Blue” image; you can view this image at any time from within the Desktop & Screen Saver pane of System Preferences (or the Desktop pane in OS X 10.2 and earlier)—it’s in the default Apple Background Images collection. However, this image can get a bit, well, boring after so many logins, so you might be wondering how you can spice up the login screen with a background image of your own choosing.

Doing so is actually very easy, as OS X simply uses the file /Library/Desktop Pictures/Aqua Blue.jpg as the login background. Whether that file is actually the "Aqua Blue" image is irrelevant…see what I’m getting at?

  1. Rename the existing Aqua Blue.jpg file in the Finder; I suggest naming it something obvious like Aqua Blue Original.jpg so that if you ever want to revert back to the original background, you’ll be able to find it easily.

  2. Rename your preferred login background Aqua Blue.jpg. You can use any image file, with the only caveat being that the image needs to be in JPEG format (JPEG image names generally end in .jpg); you can use Apple’s Preview application or the excellent Graphic Converter (http://www.lemkesoft.com/) to convert pretty much any graphics format to JPEG.

  3. Move the new login background image into /Library/Desktop Pictures.

It’s as simple as that—the next time you log in, your new background will have replaced the boring blue one. (In fact, if Fast User Switching is enabled, choose Login Window… from the Fast User Switching menu to quickly view the login window, replete with its new background.)

Adding a Text Banner to the Login Window

User Level | admin
Affects | all users
Terminal | no

You can further customize the login window by adding a text banner—a line or two of text that appears just below the Mac OS X logo. For example, I place my e-mail address and phone number in the login window on my PowerBook as a sort of “name tag.” You do this by editing the file /Library/ Preferences/com.apple.loginwindow.plist as root. Immediately after the first occurrence of <dict>, add the following two lines:

<key>LoginwindowText</key>

<string>banner text</string>

where banner text is the text you want to appear in the login window. You can use the return key to include multiple lines (so long as all the text stays between the string tags). You can also use spaces at the beginning of each line to help center the text. (However, don’t use the < or > characters within your banner text, as those characters have special meaning in preference files.) Under OS X 10.3 and later, if Fast User Switching is enabled, you can quickly view the results of your changes by choosing Login Window… from the Fast User Switching menu.

Tip

With a bit of work, you can also change the login window logo and title (the Apple logo and Mac OS X text below it). Unfortunately, the procedure to do this is fairly involved, and it differs depending on the version of OS X installed on your Mac, so I don’t have the space to include it here. If you’re running OS X 10.2 or earlier, you can use Visage, mentioned earlier in this chapter, to make these changes easily, and it’s possible that an OS X 10.3–compatible version of Visage will be available by the time you read this.

Logging Out

User Level | any
Affects | individual user
Terminal | no

Since I’ve talked so much about logging in, I should also quickly discuss logging out. When you log out, all of your open documents are closed, all running applications are quit, and your account is no longer active. You’re returned to the login window where you, or any other user, can log in.

There are four ways to log out (actually two, but you have two ways to do each). If you choose “Log Out username…” from the Apple Menu (where username is the name of the current user), or press shift+command+Q, you’ll see a dialog asking if you’re sure you want to quit all applications and log out. Click Log Out to proceed. (If you don’t click Log Out within two minutes, OS X will log you out on its own.) Alternatively, if you press the option key as you select “Log Out username,” or press shift+option+command+Q, you’ll skip the confirmation dialog and log out immediately.

Note that if an open document has unsaved changes, when you try to log out, most applications will present you with a dialog that lets you either save those changes, close the document without saving changes, or cancel the closing of the document window (which will also cancel logout). If you don’t respond to this dialog in a reasonable amount of time, logout will not continue; you’ll get an error that logout has timed out because the application failed to quit. After you respond to the application’s dialog, you can then initiate logout again. This problem can also occur if an application has “frozen” and won’t quit; you’ll need to quit the application, or force quit it if necessary, and then log out. (See Chapter 7 for more information about force quitting applications.)

Tip

If you have Fast User Switching enabled (see Chapter 1), instead of logging out you can simply choose Login Window… from the Fast User Switching menu. This presents the familiar login window, but your account will remain logged in (with all applications and documents still open). When you switch back to your account (by “logging in” at the login window), your account will be just as it was when you left it, and you can get right back to work.


Managing Startup/Login Services

In Mac OS 9 and earlier, you could control which startup files (extensions, control panels, startup items, etc.) loaded at startup—manually, by moving them in and out of particular folders, or automatically, using utilities such as Extensions Manager or Conflict Catcher. Generally the reason for doing this was to troubleshoot startup conflicts, to reduce the potential for such conflicts, or simply to reduce the amount of RAM used by the OS.

In Mac OS X, extensions, control panels, and startup items have been replaced by kernel extensions, preference panes, and startup items. Only kernel extensions actively modify the “guts” of the operating system, so to speak, so the chances for major conflicts have been reduced considerably. In addition, the amount of RAM used by most “startup” files is minimal, and because of OS X’s superior memory management, the gain from deactivating such files is much less than it was under OS 9.

Nevertheless, there are still valid reasons to activate and deactivate services and system add-ons in Mac OS X. For example, you may find that a particular screen saver causes System Preferences to crash. Or you may want to turn system-wide startup items, such as the Apache Web server, off “permanently” so that other admin users can’t enable Web Sharing. Or perhaps font conflicts are causing problems with applications or even the OS itself. A bit later in this chapter, when I discuss special startup options, I’ll talk about preventing the loading of any kernel extensions, login items, etc., by holding down the shift key at startup. However, you can also manage files on an individual basis. You can do this manually or using a utility that automates the process.

Note

In the following sections the phrase startup/login services refers to the various files loaded by Mac OS X at startup and login—such as preference panes, fonts, screen savers, and sounds—and is different from the files, folders, and/or applications each user adds to the Startup Items tab of Accounts preferences (discussed earlier in this chapter).

Managing Startup/Login Services Manually

User Level | any
Affects | depends on user level
Terminal | no

Managing files such as preference panes, screen savers, fonts, etc., is actually quite simple. As discussed in Chapter 1, each type of file must reside in a specific location in order to be loaded by the OS. Fonts, for example, must be in /Library/Fonts in order to be available to all users or ~/Library/Fonts to be available for a specific user. Preference panes must be located in /Library/PreferencePanes or ~/Library/PreferencePanes in order to appear in the System Preferences application. Third-party system-level startup items—those that don’t use the newer bootstrap daemon approach; see the note below—must reside in /Library/StartupItems. Thus, in order to prevent a particular item from being loaded and used at startup or login, you simply need to move it out of the appropriate folder— for example, if a font isn’t located inside one of the fonts folders at login, it won’t be available to users or the OS.

Note

As mentioned earlier in this chapter, in OS X 10.3 Apple added a new type of system-wide “startup item” called bootstrap daemons. Bootstrap daemons are no longer located in /Library/StartupItems, and they work a bit differently than the older Startup Items. At the time of this writing, few third-party developers are actually using bootstrap daemons, but Apple has stated that the older startup items functionality will be phased out over time; in fact, a number of Apple-provided items that were Startup Items in OS X 10.2 are bootstrap daemons in OS X 10.3. The reason I mention this here is that it’s a bit more difficult to "disable" bootstrap daemons than it is to disable traditional startup items—you need to remove a bootstrap daemon’s .plist file from /etc/mach_init.d or /etc/mach_init_per_user.d to disable it, and both of those directories are invisible by default. On the other hand, one key difference between Startup Items and bootstrap daemons is that bootstrap daemons don’t actually get started until they’re needed (by the OS or by an application), so there’s a lot less need to even consider "disabling" them.

One way to deactivate files and still keep some semblance of order is to create a matching folder in the same directory as the enclosing folder that includes the word Disabled in its name—for example, create a new folder called PreferencePanes (Disabled) inside /Library and use this folder to store systemwide preference panes that you want to disable. (If you’ve got a good grasp on user accounts and file organization at this point, you know that an admin user can modify system-wide files and thus can affect all user accounts; individual users can manage only items in their personal ~/Library folder.)

Note

As mentioned in Chapter 1, each of these types of files (preference panes, fonts, screen savers, etc.) also has its own folder inside /System/Library. The files located in these folders were installed by Mac OS X and should generally not be moved. In fact, the only way to move them is via root access. Luckily, they’re rarely a cause of problems.

Warning

As discussed earlier in this chapter, a few other types of startup processes exist: system-level startup processes provided by the OS that start during BootX, startup items/processes provided by third-party vendors that are launched during BootX (but after the system’s own processes), and login processes. Unless you’re an experienced user who is sure of what you’re doing, I should discourage you from trying to disable these services.

Although managing startup and login services is fairly easy, it’s a bit of a pain if you do it frequently since every type of file has its own folder, and every such folder exists on two or three levels (/System/ Library, /Library, and ~/Library). A much easier way to manage such files is using a utility such as Diablotin.

Managing Startup/Login Services Using Diablotin

User Level | any
Affects | depends on user level
Terminal | no

If you find yourself enabling or disabling startup and login files often, or if you just don’t want to bother mucking around in all the various Library folders, you definitely want to try the excellent free- ware preference pane Diablotin (http://s.sudre.free.fr/Software/Diablotin.html). It provides a consolidated view of all installed startup/login files and services, including fonts, preference panes, and system-wide startup items, and it allows you to easily disable or enable them.

After installing Diablotin, simply launch System Preferences and choose the Diablotin pane. In the list of items on the left, you can click the disclosure triangle next to any category of files and see all the files of that type installed on your Mac. Items with a library icon (the little picture of three books) are located in the /Library directory (and thus affect all user accounts and are modifiable only by admin users); those with a user icon (the silhouette) are located in the current user’s ~/Library folder and affect only the current user account. Clicking an item’s name in the Diablotin window provides you with information about that item (including the version number) in the information box on the right (Figure 3.6). To disable an item, uncheck the box next to its name and icon; to enable it, check the box. If you want to enable or disable items in /Library, you’ll need to authenticate using your admin name and password (click the padlock at the bottom of the window).

Note

When you disable an item in Diablotin, it’s simply being moved to a newly created Disabled folder, just as you would have done using the manual procedure described in the previous section. Enabling an item from within Diablotin moves it back to the “active” folder.

Figure 3.6: Managing installed startup/login items using Diablotin

One cause of minor problems in OS X is when a preference pane is accidentally installed twice— once in /Library/PreferencePanes for all users and again in ~/Library/PreferencePanes for the current user. This can be especially risky if the two copies are different versions (i.e., an older one and a newer one). Diablotin makes it easy to find such duplication by listing such items next to each other; you can then simply disable one of them.

Tip

If you see an item in Diablotin that you want to remove from your Mac completely, control/right-click the file’s name, and then choose “Show in Finder” from the contextual menu. The item will be presented in a Finder window; you can then drag the item to the Trash.

Checking the box next to Show System Library Items will include files located in /System/Library in the list. As I mentioned in the warning a few pages back, you generally don’t want to be changing these files; however, viewing the list this way lets you see the files provided by Apple (those with the OS X icon next to them) in the same list with the files provided by other vendors (those with the library or user icons).

Changes you make in Diablotin (or changes to these items made manually, for that matter) take effect at different times, depending on the type of file. Changes made to fonts or other application- specific files take effect the next time you launch an application that uses them. Changes made to preference panes generally take effect in two steps:

  1. The preference pane itself appears in or disappears from System Preferences the next time you launch System Preferences.

  2. The effects of the preference pane, if any, will be disabled or enabled the next time you log in.

Changes made to Startup Items—remember, I’m talking about real Startup Items that load at startup, not the Login/Startup Items in Accounts preferences—take effect the next time you restart your Mac (since they load before the login window loads).

Warning

One of the types of startup files that Diablotin doesn’t manage is kernel extensions. It’s rare that you’d want to disable kernel extensions; however, if you ever have that need—for example, if one of them is causing a startup problem—the shareware MOX Optimize (http://fly.to/infosoft) allows you to manage kernel extensions much like Diablotin lets you work with other startup files. From the MOX Optimize menu, select Mac OS X Options, and in the resulting window click the Extensions button. From the pop-up menu, choose Kernel Extensions. You can then enable or disable each extension. Keep in mind that many of these files are required by the OS, so be very careful what you turn on or off.

For Advanced Users: Disabling Services

User Level | admin
Affects | all users
Terminal | no

I mentioned earlier that you probably don’t want to disable system-level Library items, especially those in /System/Library/StartupItems, as some are essential for normal system functionality. However, advanced users may have system services that they simply don’t use—and don’t plan on using—and that they want to disable. The advantage of disabling services is, theoretically, that the OS takes up less RAM and processor resources the fewer services are running. (However, as I mentioned earlier in this chapter, such gains are likely to be small.)

If you decide you want to disable such services, you could use Diablotin, but I instead recommend the freeware utility Boot Config (http://cs.northwestern.edu/~josha/bootconfig.htm). Launch Boot Config and select a startup item from the list that’s presented, and you’ll quickly understand why I prefer this utility—when you select a service in the list at the top of the window, the Description box at the bottom of the window shows you two important pieces of information about that service (Figure 3.7). The first is a summary of what other services or objects are currently depending on the selected service; if there are any, you don’t want to disable it. In addition, if you’ve selected a "core" service (one that is generally required by the OS for standard functionality), the box will also include a message that states "WARNING: Core startup item!" You generally don’t want to disable these types of items, but experienced users may have a reason to do so.

Figure 3.7: Using Boot Config to configure startup services

To disable a startup item(s) using Boot Config, you’ll first need to authenticate by clicking the padlock icon and then providing your admin username and password. Then uncheck the box next to the item(s) you want to disable; Boot Config moves the disabled service to a new folder, /System/Library/DisabledStartupItems, where it won’t be launched at startup. When you’re done, restart your Mac. If you later change your mind and want to restore a service, use Boot Config to enable it and then restart again.

One other caveat: If you disable a service, make sure you don’t try to use it inadvertently. For example, if you disable Apache, don’t try to turn on Personal Web Sharing in Sharing System Preferences, since Personal Web Sharing uses Apache. The result could be a crash.


Stopping and Restarting Startup Processes

I’ve discussed how to set up Login/Startup Items for individual users and how to manage system- level startup processes and items. However, one topic I haven’t covered is how to stop services and processes that are already running, or how to start services that you disabled at startup or stopped manually. These aren’t things most users will need to do very often, if ever, but you’ll know how to do both after reading this section.

The various startup and login services discussed throughout this chapter can be broken down into three basic categories: (1) Mac OS X system-level services, located in /System/Library/StartupItems and launched by SystemStarter at the end of the boot process; (2) third-party system-level services, located in /Library/StartupItems and launched by SystemStarter immediately after the OS services included in category #1; and (3) user-level (and user-specific) Login/Startup Items, listed in the Startup Items tab of the Accounts pane of System Preferences and launched when the user logs in. (Bootstrap daemons, discussed earlier in this chapter, can generally be divided into two categories: system-level bootstrap daemons, located in /etc/mach_init.d, which are started at approximately the same time as system-level Startup Items (categories 1 and 2, above); and user-level bootstrap daemons, located in /etc/mach_init_per_user.d, which are started when a user logs in.)

You can view active processes, and figure out whether they’re system-level or user-level, using Apple’s Activity Monitor application, located at /Applications/Utilities/Activity Monitor. (The OS X 10.2 equivalent is called Process Viewer and is located in the same folder.) After you launch Activity Monitor, choosing Monitor Ø Show Activity Monitor opens the actual Activity Monitor window. Choosing My Processes from the Show pop-up menu provides you with a list of all processes currently running in your own account that were launched at or since login (Figure 3.8). Selecting Other User Processes shows user-level processes running in other user accounts. (This option is useful mainly when another user is logged in via Fast User Switching.) Selecting Administrator Processes shows all system-level processes, most of which were launched by SystemStarter during the boot process (or by bootstrap daemons when the processes were needed). (To see what many of these processes do, visit http://www.westwind.com/
reference/OS-X/background-processes.html.)

Figure 3.8: Using Activity Monitor to view the current user’s processes

How to stop and start processes depends on whether they’re user-level or system-level processes.

Tip

Activity Monitor actually shows all processes and applications, not just startup processes. However, it’s the easiest way to view processes by user level.

Stopping and Restarting User-Level Login/Startup Processes

User Level | normal
Affects | individual user
Terminal | no

Most user-level startup/login items are simply applications; they show up in the Dock and can be quit just like any other application. (I talk more about quitting applications in Chapter 7.) Others are background applications or daemons, which means that they don’t show up in the Dock as regular apps; however, you can stop them by selecting them in the My Processes view of Activity Monitor and then choosing Processes Ø Quit, or clicking the Quit Process button. (Reasons for quitting applications vary, of course, and the scope of why you might want to quit various applications or processes is too big for this chapter; let’s just say that troubleshooting is a frequent motivation.)

Starting or restarting such applications is also fairly easy. If you know where the original application resides, you can just double-click it to launch it again. However, some of these applications are difficult to find. For example, if you use Microsoft Entourage as your e-mail/calendar program, the reminders that pop-up for appointments, to-do items, etc., are provided by a background application called Microsoft Database Daemon, located inside the Microsoft Office folder. If you find that this application isn’t running and you want to launch it, you have to track it down, which can be a real pain. If you find yourself in this situation, the easiest solution is simply to log out and log in again. Since these processes are all user-level and launch at login, they’ll all start anew when you log in. And since you’re not rebooting, it’s a pretty quick fix. (OK, so you can actually relaunch the Microsoft Database Daemon by choosing Entourage Ø Turn On Office Notifications; however, the process might not always be this simple, and logging out and back in is often the easiest way to restart user-level login/ startup processes.)

Stopping and Restarting System-Level Startup Processes

User Level | admin
Affects | all users
Terminal | yes

System-level startup processes are a bit trickier to work with than user-level ones; luckily, most users won’t need to interact with them very often. However, if you find yourself needing to stop a system-level service, or if you had previously disabled such a service (as discussed earlier in the chapter) and want to start it again without having to restart, OS X allows you to use SystemStarter to do it.

Note

This information in this section does not apply to bootstrap daemons, discussed earlier in this chapter; it only applies to those Startup Items in /System/Library/StartupItems or /Library/StartupItems.

I mentioned SystemStarter when I explained the boot process—it’s the utility that loads services in the two StartupItems folders at startup. What I haven’t yet mentioned is that Apple has made SystemStarter available in Terminal as a way for admin users to start, stop, and restart individual services or multiple startup services at once. It uses the following, fairly simple, command format:

sudo SystemStarter action service

where action is either stop, start, or restart, and service is the name of the service you want to act on. (The sudo command will ask for your account password to authenticate you as an admin user.) For example, if I wanted to stop the Unix cron process, described in Chapter 14, I’d simply type sudo SystemStarter stop Cron <RETURN>.

If I had previously disabled cron (for example, using Boot Config, as explained earlier in this chapter), and had just re-enabled it and wanted to start it without restarting my computer, I could simply open Terminal and type sudo SystemStarter start Cron <RETURN>. The cron process would be started just as if it had been loaded at startup. You can also restart a service that’s already running by using restart in place of start.

You can also do a few other useful things with SystemStarter. If you don’t specify a particular service, SystemStarter will perform the action on all startup items. (Some words of warning: Don’t try this with the stop action, or you’ll be forced to reboot your Mac when all of the login services are stopped. In addition, using the restart option will log you out of your account, since many of the services that provide OS X’s graphical interface are quit and then started again.)

If you specify the –x option with start or restart, SystemStarter will start or restart, respectively, only Apple-provided startup services; this can come in handy when trying to figure out if third-party services are causing problems. (Note that if you’re trying to disable all services and then start only the Apple ones, you’ll need to issue a SystemStarter stop command first, then a SystemStarter -x start command.)

Finally, you can execute SystemStarter commands via SSH—useful if you’re trying to troubleshoot a problematic computer remotely—if you have Remote Login enabled in the Sharing pane of System Preferences. (I’ll talk more about Remote Login in Chapter 12.)

Note

As I mentioned earlier in this chapter, Apple is “phasing out” Startup Items in favor of bootstrap daemons. So chances are that over time, the information in this section will be useful for fewer and fewer processes—Apple’s eventual goal is to eliminate these types of Startup Items altogether.


Special Startup and Login Options

In addition to the ways in which you can customize the boot and login processes, a few special startup and login options are available. They all do slightly different things, but because they don’t fit neatly into any particular category of functionality, I’m grouping them here.

Single-User Mode: Command+S

User Level | any, unless restricted by Open Firmware
Affects | all users
Terminal | yes

If you hold down command+S at startup, you’ll be presented with a black screen containing a bunch of code (white or yellow text)—in fact, it looks a lot like Terminal. What you’re seeing here is called single-user mode, and the text you’re seeing is basically BootX (discussed earlier in this chapter) in all its glory. After it has done its thing, you’re presented with a command-line prompt. At this point you can run fsck, OS X’s built-in disk utility (discussed more in Chapter 14), or work directly with Terminal/shell commands (and thus files on your hard drive).

Warning

Single-user mode gives anyone with command-line experience pretty much unlimited access to your system. For this reason it’s definitely a security risk. If you want to be super-safe, I’ll show you how to prevent unauthorized single-user mode access—via Open Firmware Password Protection or using a special single-user mode password—in Chapter 13.

To exit single-user mode, type exit <RETURN> to continue the startup process and proceed to the login screen, reboot <RETURN> or shutdown -r now <RETURN> to restart your Mac and start up normally, or shutdown -h now <RETURN> to shut down your computer.

Tip

For a few other commands you can use in single-user mode, check out http://www.westwind.com/reference/OS-X/commandline/ single-user.html. However, be careful with these commands, as some can really screw things up if you misuse them.

Verbose Mode: Command+V

User Level | any, unless restricted by Open Firmware
Affects | n/a
Terminal | no

Holding down command+V at startup puts you into what’s called verbose mode. During BootX, verbose mode is very similar in appearance to single-user mode; however, instead of stopping when BootX finishes and presenting you with a command-line prompt, verbose mode allows your Mac to start up normally, but takes over the screen until the login screen appears, presenting a textual version of startup. (In fact, if you watch the text that goes by in verbose mode, you’ll see the same status messages you normally see during the boot panel phase of startup.)

Verbose mode lasts until the next shutdown or restart; at that time, you’ll also see a textual “play by play” of the shutdown process.

“Safe” Startup and/or Login: Shift

User Level | any, unless restricted by Open Firmware
Affects | all users (startup) or individual user (login)
Terminal | no

Former Mac OS 9 users will remember that if you held the shift key down at startup, your Mac would boot using a bare-bones system with no extensions, control panels, or other startup files loaded (including items in the Startup Items folder). The shift key in Mac OS X performs a similar trick; however, it does so in three parts, each independent of the others.

Safe boot If you hold down the shift key immediately after the boot process starts and release it after you see the gray screen with the dark gray Apple logo (hold it until the “spinning” progress indicator appears), you’ll enter what Apple calls safe mode. In safe mode, your Mac starts up with only essential kernel extensions and services, and it ignores the kernel extension cache normally used to speed up the startup process. As a bonus, this procedure also automatically runs OS X’s built-in disk check/repair utility, fsck, to ensure that your boot volume is free of problems. Safe mode can be a very effective tool for troubleshooting major startup issues, especially those caused by kernel extension problems and minor disk corruption.

Tip

If fsck detects and repairs problems during safe boot, your Mac will automatically restart; I generally recommend invoking safe boot again (using the shift key) so that fsck can immediately recheck your drive to make sure all the problems were repaired.

Note

How does OS X know if a kernel extension is “essential” or not? Inside every kernel extension package (browsable by control/right-clicking the kernel extension—or selecting the kernel extension in a Finder window and clicking the Action menu item in the window toolbar—and then choosing Show Package Contents from the resulting contextual menu) is a text file at /Contents/Info.plist. Essential files include a "key" variable called OSBundleRequired in the text of this file. (I’ll talk more about packages in Chapter 4.)

Prevent auto-login If you have your Mac set to auto-login, as discussed earlier in this chapter, pressing the shift key just after you see the boot progress panel (the white panel that shows which services are loading), and holding it down until you see the standard login window, prevents auto- login. You’ll then have the opportunity to log in normally or to allow another user to log in. (If you hold shift+option, not only will auto-login be prevented, but the login window will also include the Other… option noted earlier in the chapter.)

Safe login Finally, if you hold down the shift key from the login screen until you’re completely logged in (the point at which you can actually start using the Finder), no personal Login/Startup Items (those listed in the Startup Items tab of the Accounts pane of System Preferences) will be opened, and any Finder windows that were left open during your previous session will be closed. This “safe login” affects only the user currently logging in, and is a nice trick to figure out if one of your Login/Startup Items is causing problems.

These three procedures are independent of one another: You can do one, a combination of any two, or all three. The only caveat is that if you don’t want to take advantage of all three, the timing is a bit tricky. For example, if you want to permit auto-login but suppress login/startup items, you have to wait until the instant you see your Desktop appear on the screen and then press the shift key. If you want to use safe mode but allow auto-login, you need to release the shift key as soon as you see the gray boot screen with the gray “spinner.”

Once you’ve used safe mode and/or safe login to isolate a problem, you should restart and let your Mac start up normally to ensure that all necessary kernel extensions and services are loaded.

Accessing “Terminal” at Login: Console Login

User Level | any, unless restricted by Open Firmware
Affects | n/a
Terminal | yes

There are times when you may need or want to use Terminal to work with files or to fix a problem. However, what if the problem you’re trying to fix prevents you from logging in? Or what if you you’re not logged in, and you want to quickly use Terminal without having to log in, launch Terminal, complete your task, and then log out again? The solution to both of these problems is to log in as “console.”

Note

Logging in to console is different from entering single-user mode at startup. Single-user mode is accessible to anyone, and no startup services are loaded; console login, on the other hand, requires a valid OS X user account and, since it occurs after the boot process, provides access to all of OS X’s startup services. You’re basically logging in normally, but without the fancy interface.

  1. If your Mac is currently shut down, press the power button to start up. Once you see the login screen, go to Step 2.

  2. If you had your Mac’s login options set to show “Name and password,” skip to the next step. If you have the login window set to display the “List of users” (login pictures and usernames), click the Other… user—it should be the last icon listed—and press return to bring up the name and password dialog. If Other… isn’t an option, press option+return and then click any user. This should present you with the Name and Password fields.

  3. In the Name field, type >console (including the > character) and press return (you don’t need to enter a password). You’ll be presented with what looks like a Terminal window, but it will have taken over the entire screen. You’re now working directly with the command line.

  4. At the login prompt, enter your username and press return. (If you don’t see the prompt right away, be patient; sometimes it takes 20–30 seconds.)

  5. Enter your account password when prompted.

You’re now logged in to your computer, but without the user interface. You have the same access as if you had booted into OS X normally. When you’re done doing what you need to do, type exit <RETURN>; you’ll be logged out and the login window will reappear. You can use console login as often as you like, and in fact I frequently use it to do quick things that don’t require a full login (although Fast User Switching has alleviated that need quite a bit!).

Note

Console login requires that no users be logged in. This means that if Fast User Switching is enabled, and another user is currently logged in, you won’t be able to use console login; you’ll have to log in normally instead.

Note that the “console” you use for console login is different from Mac OS X’s Console application, discussed in Chapters 7 and 14. Terminal login would probably have been a better name for Apple to choose for console login (or Console a better name for Terminal), since console login is very similar to working in Terminal. (Was that confusing enough for you?)

Tip

Instead of typing >console in the login window, you can also type a number of other commands: >exit quits the login window and relaunches it, >power shuts the computer down, and >restart restarts the computer.

Open Firmware: Command+Option+O+F

User Level | admin
Affects | all users
Terminal | yes

Open Firmware is part of your Mac’s BootROM, discussed at the beginning of this chapter. It controls your computer for the short period between hardware initialization and the processes controlled by BootX. As such, it’s in the unique position of controlling all access to your Mac. Open Firmware can come in handy for the average user in two situations. First, if you have a CD or DVD that simply won’t eject no matter what you do, typing eject cd <RETURN> in Open Firmware will force your Mac’s built-in CD or DVD drive to eject. Second, and more significant, Open Firmware allows you to prevent access to any of the special startup options discussed above, as well as any of the methods of choosing a startup volume or system discussed earlier in this chapter. By setting an Open Firmware password, only a user (presumably you) with that password will be able to access any of these functions, thus closing a good number of Mac OS X security loopholes (booting into OS 9, booting off of a CD, accessing single-user mode, etc.). I’ll explain how to set up an Open Firmware password in Chapter 13.

Tip

You can invoke Open Firmware at startup by pressing command+option+O+F; however, unless you have a very specific reason to access Open Firmware, there’s not much to do or see. If you ever find yourself in Open Firmware and don’t know how to get out of it, type mac-boot <RETURN> to continue booting up or type shut-down <RETURN> to shut down. (Apple provides a list of Open Firmware commands at http://developer.apple.com/documentation/ Hardware/DeviceManagers/pci_srvcs/pci_cards_drivers/ PCI_BOOK.64.html. However, be careful using these commands unless you know what you’re doing—some of them are quite powerful.)


Moving On...

Team LiB

Moving On…

You’re almost ready to get down and dirty with the everyday use of your Mac. However, I’ve got one more topic to cover first, and that’s installations. Since a number of the exercises and tips you’ll be seeing in the rest of the book entail installing third-party software, and you may need to install (or uninstall) software for other reasons, understanding installations is an important skill to have. Plus you never know when you’ll have to install or reinstall the OS itself, or parts of it.


Chapter 4: Installations, Inc.

(Or: Mastering Mac OS and third-party installations.)

Overview

When you first took your Mac out of the box, it came with most of the software you needed to be a fairly functional member of the computer-using public: e-mail client, web browser, word processor—maybe even the AppleWorks or Microsoft Office suite of applications. However, at some point you had to (or will have to) install other software, whether it’s commercial software, games, or even shareware or freeware you’ve downloaded from the Internet. In addition, you may want to (or, unfortunately, need to) reinstall software that came with your computer. Finally, there are sure to be times when you have to undertake the (sometimes daunting) task of uninstalling software.

Because I’m assuming that you’re already using Mac OS X, I’ll talk first about installing applications and third-party software, including system add-ons. Then I’ll talk about Mac OS X and Apple software installations and updates. I’ll then move on to uninstalling software. Finally, I’ll show you how to transfer your files from one computer or hard drive to another and how to support some “unsupported” computers and peripherals.


Installation Basics

If you’ve ever taken a curious trip around your hard drive, you’ve surely discovered that Mac OS X includes tens of thousands of files, organized in hundreds and thousands of folders and sub-folders. If you’re a former user of Mac OS 9 or earlier, the sheer number of files present is enough to make you wonder if upgrading to OS X was such a great move. However, the truth is that despite the large number of files, OS X and its applications are organized in a fairly logical manner. Understanding the basics of application and system software organization will help you better understand installations (and installation troubleshooting).

Where Are Things Installed?

I spent a good amount of time talking about OS X’s file and folder organization in Chapter 1, but now is a good time to briefly revisit this organization as it relates to software installation:

Mac OS X On most computers running Mac OS X, the operating system itself accounts for the bulk of files and folders on the hard drive. Because of the sheer number of files installed by Mac OS X, explaining the location and purpose of each and every file would take more space than this entire book! Thus, for the sake of this discussion, I’ll generalize a bit. Core OS-related files are installed inside the directory /System at the root level of your hard drive. Support files are located in /Library, as well as in a few invisible folders at the root level, such as /private (which contains the /etc, /tmp, and /var directories), /sbin, and /usr. (I’ll talk more about invisible files in Chapter 5, "Finagle Files and Foil Finder Frustration.") I’ve already mentioned a few such files in the preceding chapters, and you’ll work with a number of others before the book is through.

Applications I discussed Mac OS X’s “parallel” folder structure in Chapter 1; application location is another example of parallel folders. Applications are generally located in /Applications (for all users) or in ~/Applications (for individual users). Although applications can technically be installed anywhere, there are good reasons to limit them to these folders—see "Moving Installed Applications," later in this chapter, for more information.

Note

As discussed in Chapter 1, the ~/Applications folder (within each user folder) isn’t created automatically, so each user will need to create it within their own folder if they want to take advantage of it.

Many applications also require support files. These files are often located within the application itself (see “Packages,” later in this chapter); however, this isn’t always the case. Inside /Library (for all users) and ~/Library (for individual users), you’ll most likely find a folder called Application Support, inside which you’ll find folders containing support files for various applications. Applications may also store fonts, contextual menu plug-ins, help files, and other necessary support files inside specialized folders in the /Library directories, when appropriate. In addition, as mentioned earlier in the book, applications generally save their preferences inside /Library/Preferences and ~/Library/Preferences (again, depending on whether the preferences apply to all users or if each user has their own preferences). Finally, if an application requires a system-wide startup item that needs to be active at startup (such as the backup scheduler used by Dantz’s Retrospect backup application), it will most likely be located in /Library/Startup Items. (Note that many developers unfortunately ignore Apple’s guidelines and store their support files in a folder at the root level of /Library or ~/Library.)

If you’re running Mac OS X on a computer that previously ran Mac OS 9 or earlier, you may also have a folder at the root level of your hard drive called Applications (Mac OS 9). This is where applications that were previously installed under Mac OS 9 are stored. You should be able to run many of these applications using the Classic environment (see Chapter 8, “Clobbering Classic”).

Utilities Utilities are actually just applications, and there really is no official way to differentiate between an application that’s a utility and one that isn’t—I generally think of utilities as applications that do something to your computer (fix it, alter its functionality, etc.) or help you monitor your computer (e.g., Activity Monitor lets you monitor processes and network traffic). Mac OS

X has a special folder inside the Applications folder called Utilities. This folder contains all of the utilities that are installed by OS X (e.g., Terminal, Disk Copy, Network Utility), as well as any utilities installed there by third-party installers or placed there by users.

System add-ons You can alter or enhance the way Mac OS X works in many ways. I’ve already discussed a few in the book (screen savers and preference panes). However, where these add-ons reside depends on the type of add-on. I’ll go into more detail about these locations in “Adding Add-Ons,” later in this chapter.

Unix software In addition to software written for Mac OS X, many command-line Unix applications are pre-installed by Mac OS X. You can also install many other Unix applications yourself.

I’ll talk much more about installing Unix software in Chapter 15, but for now I’ll just briefly mention that a good number of command-line Unix applications are located in the invisible /bin, /sbin, and /usr directories. Mac OS X itself uses many of these applications regularly, and many are accessible to you via Terminal. In addition, if you ever install additional Unix software—for example, software obtained via Fink, as described in Chapter 15—you may also have a /sw directory at the root level of your startup drive.

Packages

If you previously used a Mac running Mac OS 9 or earlier, you’ll remember that when you installed an application, you generally also installed various other files needed by that application. Sometimes these files were conveniently located in the same folder as the application itself; however, they were often scattered across your hard drive—some in the Extensions folder, some in the Control Panels folder, and some in various other locations depending on the application.

This made for a very messy hard drive, and for potential problems. In Mac OS 9, an application might stop working as a result of seemingly innocuous actions, such as:

  • Moving the application from its original location

  • Moving an application around within sub-folders of its own folder

  • Accidentally moving or throwing away an essential support file (which could be easy to do because an application’s folder was often littered with support files)

  • Accidentally moving or disabling support files such as system extensions

Mac OS X makes some impressive strides toward eliminating this type of situation by using what are called packages (technically called bundles, but since Apple frequently calls them packages, I’m going to do so, as well). A package is actually a folder of files that acts like a single file. For example, an application package is a folder that contains the application and its support files; however, the package looks and behaves like an application—double-clicking it doesn’t open the folder; rather, it launches the application inside. As another example, an installer package is a folder that contains all the files and/or resources needed for a particular software installation; double-clicking on this kind of package launches Mac OS X’s Installer utility.

File packages have a number of advantages. Most important, as I’ll discuss shortly, is that they make installing new applications much easier. But in addition, they also make it less likely that a user will accidentally move or delete files needed by applications, and they make it easier to move applications and other types of packages around (including deleting them when you want to do so).

To see a package in action, navigate to /Applications and locate the Mail application. If you hold the control key and click the Mail icon (or right-click if you have a multi-button mouse), you’ll be presented with a contextual menu. (In OS X 10.3, you can also select Mail and click the Action menu item in the Finder window toolbar.) Select Show Package Contents from the menu. You’ll be presented with a new Finder window with a folder called Contents. Inside that folder are the actual contents of the Mail package (Figure 4.1). If you dig into the Resources folder, you’ll even see the various TIFF graphic files used by Mail for buttons and toolbars.

Figure 4.1: The Contents folder of the Mail.app package

There are actually several types of package files. If you’ve chosen to view file extensions in the Finder (via Finder preferences), you’ll recognize some packages by their file extension: Installer packages end in .pkg; application packages end in .app. Files that end in .bundle, .framework, and .menu are a few other examples. All of these are examples of bundles of files that appear in the Finder as single files rather than folders.

It’s possible to create your own packages, but you really don’t want to do so unless you’re familiar with all of the types of files and information that need to be included; if you’re not, you’ll be left with a package that doesn’t do anything. For more information on packages, check out http://developer.apple.com/ techpubs/macosx/Essentials/SystemOverview/AppPackaging/.

Warning

If you remove the file extension (.app, .pkg, .bundle, etc.) from the name of a package or bundle, it will no longer function properly; likewise, if you add a package extension to the name of a normal folder or file, it will become a package, but it won’t function like one. In fact, you may not be able to easily get your folder back. So be careful with file extensions. (See Chapter 5 for more information on file extensions.)

Getting a List of Files in an Installer Package

User Level | any
Affects | n/a
Terminal | no

If you’re really interested in the contents of a particular installer package (or even if you just want to see such a list once so you never have to wonder again), a neat little AppleScript called QuickBom (http://homepage.mac.com/bhines/applescripts.html) will show you. Drop a .pkg file onto the QuickBom icon, and QuickBom will create a new TextEdit document with a list of every file inside the package, organized by file path. (QuickBom is actually an AppleScript interface for the Terminal command lsbom, but it automates the process.)

Moving Installed Applications

Throughout the rest of this chapter I’ll be talking about how to install (and uninstall) software, including applications, system software, and system add-ons. However, before I do so, I want to quickly talk about moving files, including applications.

Many users (including myself) like to keep their hard drive neat and orderly; they often do this by rearranging their files and applications into what is, to them, a more logical organization. For example, under OS 9 I liked to create a folder called Internet inside my Applications folder and put any Internet-related applications inside. However, this isn’t always such a good idea under Mac OS X, which can be quite strict when it comes to file locations. As you might expect, system-related files only work properly when they’re installed in the correct locations. However, because of permissions issues, and even software updater issues, many other files must also be in particular locations.

Specifically, I mentioned earlier in this chapter that applications should be located in /Applications or ~/Applications. There are a number of reasons for this:

  • The permissions on these folders are set to provide the appropriate users with access to applications. If an application was installed in /System/Library, for example, only the root user would be able to use it; by installing applications inside the Applications folders, all users (or a particular user, in the case of ~/Applications) can use them.

  • Some applications are written so that they must be located in one of the Applications folders; if they aren’t, they won’t function properly.

  • A number of OS X features, such as Services (discussed in detail in Chapter 7), depend on applications being located in one of the Applications folders. Any applications not located in one of these folders won’t be able to take advantages of such features.

  • Many utilities that provide quick access to applications do so only for applications located inside these folders. (I’ll discuss some of these utilities in Chapters 5 and 6.)

  • Mac OS X maintains a database of installed applications; this database is used, for example, whenever you double-click a file to open it. OS X updates this database automatically whenever it detects a newly installed application; however, it does this only for applications that reside in the official Applications folders.

  • In my opinion, it simply makes your computer more organized and easier to use if applications are conveniently located in the Applications folders.

In addition to these reasons, in the case of Apple’s own applications (those installed with Mac OS X), there’s an even more persuasive argument for keeping them where they were originally installed: The Mac OS X software updaters will sometimes only update software that resides in its original location. For example, if you move the Mail application out of the /Applications directory, or even just move it inside a sub-folder within /Applications, a Mac OS updater (an update to Mac OS X, or an application-specific updater) may not update the Mail application. Sometimes the updater will look for Mail in its original location, and when it doesn’t find it there, it will do nothing, or will install a new package of files where Mail should be. This package will look like a new Mail application package but will only contain the files that were supposed to be updated within the Mail package. In other words, it will be incomplete and won’t function. Apple claims that as of OS X 10.2.3 this is no longer an issue; however, I’ve still seen reports of it occurring, even in Panther (OS X 10.3).

So in general, it’s best to leave applications where they were originally installed. If, like me, you hate the idea of opening the /Applications directory and having to slog through files just to find the application you want to use, you’ll appreciate Chapter 5; I’ll spend a good deal of time in that chapter talking about other ways to access applications and files.


Installing Third-Party Software

So you’re tired of using TextEdit for all your word processing, or you want to try a new Web browser. Or maybe you read about a cool system add-on that makes it easier to access your files. Whatever the reason or need, you’ll eventually want to install software that didn’t come with your Mac. In the following sections, I’ll talk about the various ways in which you can install third-party software, along with a few tips on how to do it better. (If you’ve already installed quite a bit of third-party software, these sections might be a bit elementary. However, I recommend that you at least skim along—you still might find something new.)

There are generally three ways to install software in Mac OS X: using a standalone installer application, using the Installer utility along with an installer package, or simply copying the application to your hard drive. Which method you use is actually up to the software developers, as they decide how they want to distribute their software. But before I talk about each of these methods, I’d like to mention the ways in which software is distributed under Mac OS X.

How Software Is Distributed

Whereas 5 to 10 years ago most software was distributed via floppy disk (and occasionally via CD), today most commercial software is distributed via CD or Internet download, and shareware and free- ware are distributed almost exclusively via the Internet. Software on CD is fairly easy to access, as you simply need to put the CD in your computer and either run an installer or copy files to your hard drive manually. However, downloading software poses a few unique challenges, mainly slow transfer speeds and the fact that Macintosh resource forks (file contents unique to Mac files) don’t always transfer correctly over the Internet. Thus, software downloaded from the Internet generally comes encoded and compressed in a format that reduces file size and preserves file contents.

Former users of Mac OS 9 are most likely familiar with the StuffIt compression format, which has historically been the most common format for Mac-related downloads. (These file archives had names that usually ended in .sit.) By double-clicking a StuffIt-encoded file, the StuffIt Expander application launched, expanded the compressed file, and then deleted the original, leaving you with the uncompressed contents. This format is still common under Mac OS X, and StuffIt Expander is pre-installed with OSX. Windows users, on the other hand, are more likely to be familiar with the .zip format (archives of which are often called Zip files). Because of OS X’s Windows compatibility features, Zip files are becoming more common on the Mac platform. (In fact, as you’ll see in Chapter 5, you can create Zip archives directly from the Finder.) Finally, due to Mac OS X’s Unix underpinnings, several Unix file compression formats are also becoming more common on the Mac platform; you’ll recognize these types of file by their file extensions: .tz, .tar, .gzip, .gz. Luckily, all of these files can be decoded/decompressed using StuffIt Expander. You can usually just double-click them and StuffIt Expander will launch and do its thing. In the rare cases where this doesn’t work, you can drag the compressed file onto the StuffIt Expander application (inside ~/Applications/Utilities).

One increasingly common file type that you’ll surely find yourself downloading (or that may appear once you’ve “unstuffed” one of the file formats mentioned above) is the .dmg format. This type of file is called a disk image because it’s actually an image of a mountable volume. If you double- click a .dmg file, Mac OS X will "mount" the disk on the Desktop just like a CD, Zip disk, or external hard drive. (If you’re using OS X 10.3 or later; this will happen fairly transparently; in OS X 10.2 or earlier, Apple’s Disk Copy utility will launch and mount the image.) You then open the disk to access its contents (which can be an installer, an installer package, or files and folders). When you’re done with the disk, simply drag it to the Trash to "eject" it (unmount it). You can then throw away the original disk image file or save it for later use or backup.

Once you’ve got your software ready to install, how you proceed depends on how the developer has provided it.

Start Sidebar
Internet-Enabled Disk Images

A specific type of disk image that’s becoming popular is what Apple calls an Internet-enabled disk image. (Oddly enough, these types of files really have little to do with the Internet other than the fact that you’re likely to download them.) An Internet-enabled disk image looks exactly like a standard disk image. However, when “mounted” (either by your browser or by you double-clicking it), the contents of the disk image are copied to the same location on your hard drive as the image, and then the image is unmounted and (apparently) deleted. This can be a bit confusing when your disk image suddenly disappears. However, Apple’s goal with Internet-enabled disk images appears to be to replicate the familiar behavior of StuffIt archives with the “delete after expanding” preference enabled in StuffIt Expander—the archive is replaced by its contents. Once you think of them in that context, they do seem to make sense (although I still think the name is weird).

If you’re the type who likes to keep disk images around for backup, or if you need to install the same software on multiple Macs, you may find Internet-enabled disk images to be a pain because the image itself appears to be deleted. However, it’s not really gone—it’s simply been moved to the Trash. You can just open the Trash and retrieve it; even better, once you retrieve it from the Trash, it’s no longer “Internetenabled”—it works just like a standard disk image. (Internet-enabling is a single-use feature.)

Alternatively, it’s actually possible to tell Mac OS X to treat Internet-enabled disk images just like any other disk image (i.e., to ignore the “Internet-enabled” feature). To do so, launch Terminal and type:

defaults write com.apple.frameworks.diskimages skip-idme true <RETURN>

If you later decide that you want to re-enable the standard handling of Internet-enabled disk images, launch Terminal and type:

defaults delete com.apple.frameworks.diskimages skip-idme <RETURN>

To learn more about Internet-enabled disk images, including how to create your own, check out Apple’s Developer documentation at http://developer.apple.com/ue/files/iedi.html. You can also use a utility such as the free iEnable (http://www.crabbyapplesoftware.com/) to "enable" your own disk images.

End Sidebar

When Disk Images Don’t Mount

If a file ends in .dmg and double-clicking it doesn’t mount it, you have a few ways to open it properly. If you’re running OS X 10.3 or later, you can drag the image file onto /System/Library/CoreServices/DiskImageMounter.app, which is the actual application the Finder uses to mount disk images. You can also launch Disk Utility, drag the disk image into the volume list on the left side of the Disk Utility window, and then select the image from the list and click the Open button in the toolbar.

If you’re running OS X 10.2 or earlier, you can drag the .dmg file onto the Disk Copy application (/Applications/Utilities/Disk Copy). You can also launch Disk Copy manually, and then select File Ø Mount Image…; browse to the image file and click Open. The image will be mounted on the Desktop. Or you can select the .dmg file in the Finder, and then select File Ø Get Info. In the "Open with" panel, select Disk Copy from the pop-up menu. The next time you double-click the image file, it will be mounted by Disk Copy.

For any version of Mac OS X, you can also drag the image file onto a third-party utility like Mount (http://mount.houchin.us/), which is often quicker than Apple’s own disk-mounting procedure because it skips the sometimes lengthy "verification" step.

Installer Applications and Packages

Stand-alone installers and installer packages work similarly; both use an application to place files and folders in the appropriate places on your hard drive. They tend to be used when software requires that files be placed in various locations around your drive, so as to reduce the chances that the user will place something incorrectly (and to just make things easier on us users).

Although not as common as they were under Mac OS 9 and earlier, stand-alone installers are still used for some software under OS X. There are several different brands of installers (from companies such as MindVision and Installer Vise), and some companies (such as Microsoft) actually build their own or customize other companies’ installers. However, they all work in a similar manner: You double-click the installer application, and it installs the software.

Some installers will require you to authenticate (provide an admin-level username and password), especially if the installer needs to copy files to /Library or /System/Library. In the case of application installers, most automatically place the application in the default location of /Applications. However, some will give you the option of choosing where the application itself is installed; if you want to limit use of the application to just your own user account, make sure you choose ~/Applications as the location for installation. Finally, if the installer is installing any system add-ons, you may be asked to decide whether the add-on affects all users or just you; see "Adding Add-Ons," later in this chapter for details.

Installer packages work much like installer applications do; you simply double-click them, and follow the instructions on-screen. The major difference is that instead of using their own built-in installation software, installer packages use Apple’s Installer utility (/Applications/Utilities/ Installer). When you double-click an installer package, Installer launches and uses a script contained within the installer package to install files in the appropriate locations. Installer will usually ask you to select a destination volume for the install (Figure 4.2); if you have multiple volumes/partitions, select the one you’re currently using as the startup disk (unless you really want to install the software onto another volume). Once installation is complete, you can either quit Installer, or you’ll be asked to restart your computer.

Click To expand
Figure 4.2: The Select a Destination screen in the Installer utility
Tip

When using Apple’s Installer utility, it’s often possible to see a list of files that are going to be installed. Once you get to the Select a Destination screen, select File Ø Show Files to be presented with a window that lists all the files about to be installed, including the exact location into which each will be copied.

Installers are supposed to make software installation as easy as possible, and for the most part they do just that. However, the downside of installers and installer packages is that because they do everything automatically, it’s often harder to remove the software that’s installed. I’ll talk about that later in the chapter (in “Uninstalling Software”).

Do I Really Need to Restart after the Installer Is Finished?

Some installers or installer packages will require that you restart your computer after installation is completed. This is often the case when software has been installed that needs to be loaded by the OS at startup. For example, Dantz’s Retrospect backup system requires a startup item called RetroRun for automated backups; the only way to ensure that this software is running is to restart so that it loads at startup. Another time a restart may be required is if the installed software replaced an earlier version that was already running. For example, a utility that alters Open/Save dialogs most likely loads code into memory that affects the way Open/Save dialogs are displayed. Updating the utility software doesn’t necessarily unload the old code from memory. So to avoid problems that might arise from having both old code and new code running at the same time, the installer either suggests or requires that you restart after installation (or at least requires that you log out and then back in, for software that’s running only in your own account).

Some installers quit all running applications before they start the installation process and don’t give you any option other than restarting afterward; however, such installers are becoming more and more rare under OS X. Most that require a restart will let you finish tasks in other applications and then switch back to the installer and click the Restart button. If you really don’t want to take the advice to restart, you can usually force the installer to quit without restarting. Select Force Quit… from the Apple Menu, select the installer in the resulting list of applications, and then click the Force Quit… button. However, keep in mind that there’s usually a good reason for an installer to require a restart, so if you use this tactic, I still recommend restarting as soon as possible.

Drag-and-Drop Installing

Earlier in the chapter I talked about packages. One major advantage of packages is that they make installing software extremely simple. Rather than requiring a software installer to copy files to various locations on your hard drive, a package allows software to be distributed as a single “file” (remember, it only looks like a single file) that can be copied by the user to the hard drive. You simply mount the CD or disk image (.dmg file) in the Finder and then drag the software package from the CD or image to the appropriate location on your hard drive.

The only thing that’s a bit tricky about drag-and-drop installations is where to put the software. Luckily, most developers include a ReadMe file that includes detailed installation instructions. By now, because of how many times I’ve talked about it in this chapter, you should know exactly where to place applications. The other common type of file you might download is a system add-on (preference panes, screen savers, etc.). Because these may need to be installed in one of a number of places, I’m going to talk about them separately in the next section.

Tip

If you place the Applications folder in your Finder window toolbars or sidebars (as discussed in Chapter 5), when you mount and open a disk image containing an application, you can simply drag the application icon from within the open Finder window onto the Applications item in the toolbar or sidebar to copy it to the Applications folder. This saves you from having to open another Finder window and navigating to /Applications in order to install the application. (If the toolbar and sidebar are hidden in the disk image window, press command+option+T—or command+B if you’re using OS X 10.2 or earlier—to show them.)

Note

Being a power user doesn’t mean you can ignore the documentation that comes with software. As boring as some of them might be, you should always read the ReadMe files or browse through the installation/system requirements sections of software manuals. They often contain important information about installing and/or using the software, and not reading them could get you into trouble (due to incompatibilities, requirements, or other issues). A couple minutes of reading could save you a few hours of headaches!

Adding Add-Ons

In addition to applications, utilities, and system updates, you can also install software that changes how the Mac OS works. I mentioned a couple of these products in Chapter 2—namely screen savers and preference panes—but there are also a number of other types. Most of these add-ons are provided without installers; that is, you’ll have to drag and drop them into the correct locations manually.

System Add-On Locations

In order to function properly, system add-ons need to be installed in specific locations that differ depending on the type of add-on. The following is a list of the most common system add-ons you’ll encounter, what they do, and where they are installed. As discussed in Chapter 1, in all of these examples, items in /Library will be available to all users whereas those in ~/Library will only be available to the specific user in whose home directory they’re installed:

Contextual menus As you’ve already seen in some of the exercises you’ve done in the book, contextual menus (often called right-click or control-click menus) are everywhere in Mac OS X. They’re called contextual menus because the contents of the menus change depending on the context in which the menus are activated. You can add to the functionality of contextual menus by installing contextual menu plug-ins. I’ll provide some examples of excellent plug-ins in Chapter 5, but regardless of the plug-in, to work properly it must be located in /Library/Contextual Menu Items or ~/Library/Contextual Menu Items.

Fonts Fonts are often installed with other software, but they’re also available for download via the Web or on CDs you can purchase, and some users even create their own. To be usable by applications, they should be located in /Library/Fonts or ~/Library/Fonts. (Fonts installed in your Classic System Folder will also be available in OS X.)

Note

I talk more about fonts on the book’s website (http://www.macosxpowertools.com/).

Internet plug-ins Internet plug-ins, such as those used for Flash, Shockwave, and Windows Media files, provide additional functionality to Web browsers. In past versions of the Mac OS, each browser had its own plug-ins folder; in Mac OS X, there two universal plug-ins folders that can be accessed by all browsers. These are /Library/Internet Plug-Ins and ~/Library/Internet Plug-Ins.

Preference panes As I discussed in Chapter 2, third-party preference panes will be accessed by the System Preferences application when they’re located in /Library/PreferencePanes or ~/Library/PreferencePanes.

Printer drivers and PPDs Although Mac OS X contains drivers for many printers, printer vendors and other developers can add support for other printers by installing drivers in /Library/Printers or ~/Library/Printers. (I’ll talk a lot more about adding printer support in Chapter 12 "Printing Practicalities.")

Screen savers I talked about using third-party screen savers in Chapter 2. Any screen saver file located in /Library/Screen Savers or ~/Library/Screen Savers will be available to the Desktop & Screen Saver pane of System Preferences (Screen Effects in OS X 10.2 or earlier).

There are other types of system add-ons that you can install, but these are the ones you’re most likely to encounter. How do you install them? Read on.

Installing System Add-Ons

Like applications, system add-ons can be installed manually or via an installer application. However, you have other options, as well, such as third-party add-on managers. In addition, because system addons often affect the way the OS operates, installing them is more likely to require a restart, or at least a logout/login, than installing most applications.

Installing System Add-Ons Manually
User Level | normal or admin
Affects | individual user or all users
Terminal | no

In my experience, the vast majority of Mac OS X system add-ons—whether commercial, share- ware, or freeware—are installed manually: You download them over the Internet and manually copy them from a disk image, or from your downloads folder, to the appropriate location. As I described in the previous section, where you move them depends on the type of add-on; again, be sure you read the ReadMe file that comes with the file to be sure.

Installing System Add-Ons Using an Installer
User Level | normal or admin
Affects | individual user or all users
Terminal | no

Although many add-ons require manual installation, some do come in the form of an installer application. Sometimes this is because the add-on requires that multiple files be installed in multiple locations; other times it’s simply because the developer preferred to provide an installer. One thing such add-on installers generally have in common is that they ask you whether you want the add-on to affect all users or just your own user account. As I explained previously in this chapter and in Chapter 1, this decision affects whether it’s installed in /Library or ~/Library (Figure 4.3).

Figure 4.3: Some installers ask whether you want the system add-on to be installed for the current user or for all users.
Installing System Add-Ons Using Alfred
User Level | normal or admin
Affects | individual user or all users
Terminal | no

Another method for installing system add-ons is to use a third-party add-on/plug-in manager such as the shareware Alfred (http://www.inferiis.com/products/alfred/), which has the very cool ability to automatically install them for you. To install a system add-on, simply drag it onto the Alfred icon in the Finder (or, if it’s already running, in the Dock). In Figure 4.4, I’ve dropped a preference pane, MenuMeters, onto Alfred. Alfred presents a window telling me that the file is a preference pane and will thus be installed in one of the PreferencePanes directories. It also gives me the option of installing MenuMeters for just my account (User), for all users (Local), or for the Network domain; notice that I’m prevented from installing it in the core operating system (System). I could also install it now but disable it until I’m ready to use it (in which case it gets installed in a folder called PreferencePanes (Disabled) in the appropriate Library folder). For example, clicking Enabled, User, and then Install installs the preference pane into ~/Library/PreferencePanes.

Figure 4.4: Using Alfred to install system add-ons

Alfred also has some other useful features worth mentioning. It actually installs files based on rules. For example, the Preference Panes rule, demonstrated in the previous paragraph, says that if a file ends in .prefPane and has a file type of BNDL (I’ll talk more about file types in the next chapter), then it should be installed in the PreferencePanes directory inside one of the Library folders. What’s interesting about this approach is that you can create your own rules. For example, after I install software, I like to keep the .dmg file handy in case I need to install it again or want to install it onto a different computer. I have a folder on one of my hard drives where I keep these archived .dmg files. I’ve created a rule in Alfred that says if a file ends in .dmg, move it to my archive of installers. After I’ve installed software from a disk image, I drag the .dmg file onto Alfred, and it automatically files it away for me.

Finally, much like Diablotin (which I talked about in Chapter 3), Alfred lets you manage system add-ons such as preference panes, screen savers, fonts, and contextual menu items. Select Window Ø Alfred for a list of all types of files you can manage. In the toolbar, use the Layout buttons to choose a two- or three-column layout. Now when you select a type of file in the left column, the next column lists all files of that type installed on your Mac. You can then enable or disable individual files. (Although the change is immediate, sometimes a restart or logout/login will be necessary for the results of the change to take effect.)

Log Out/Log In or Restart?

When you install, activate, or deactivate system add-ons, you’re generally changing the way the system behaves or its capabilities. In the case of screen savers, the change is immediate—a new screen saver will be available the next time you open System Preferences (you may need to quit System Preferences, and then launch it again, if it was running when you made the change). However, in the case of addons that change the way your Mac works, such as contextual menu plug-ins and certain preference panes, to gain the added functionality the software provides, you’ll need to log out and then back in or, in the case of certain add-ons that affect the startup process itself, to restart your computer. Generally the ReadMe file that accompanies the software, or the installer, if the software used one for installation, will tell you when this is necessary.


Installing Mac OS and Apple Software

In some cases, installing software from Apple, such as applications and OS updates, works just like installing third-party software. However, most of the time you’ll likely prefer to install Apple software using OS X’s Software Update application or a Mac OS X installer CD. In the following sections, I’m going to show you how to get the most out of Software Update, then talk briefly about installing Apple software manually, and finally get into the nitty-gritty of installing (and reinstalling) Mac OS X itself.

Note

If you have Fast User Switching (described in Chapter 1) enabled, you should make sure all other users are logged out before installing an update to Mac OS X itself.

Note

Whenever you install an update to Mac OS X, I recommend running the Repair Disk Permissions feature of Disk Utility (described in Chapter 1) immediately afterward. Many users have found that doing so after installing an update to OS X avoids problems.

Bending Software Update to Your Will

Apple first introduced Software Update in Mac OS 9; some people used it regularly, others never even realized it existed. However, in Mac OS X, Apple has designed Software Update to be the way for users to keep their OS and Apple-provided application software up-to-date. This is a very good thing in my opinion. Apple releases minor updates to the operating system, and new versions of applications, on a fairly regular basis; however, in the past, many users were never even aware that such updates were available. Only people who actively kept track of software updates—from websites, mailing lists, or newsgroups—would know about every new release.

Note

Although Software Update generally updates only Apple software (Mac OS X and applications such as iTunes, iMovie, and iPhoto), a few non-Apple applications that are installed with Mac OS X, such as Microsoft’s Internet Explorer, have also been updated via Software Update. Conversely, as I pointed out in Chapter 2, minor updates to Apple’s QuickTime software—and third-party QuickTime plug-ins—are often provided via the Update tab of Quick- Time preferences.

With Software Update, your computer will check for updates for you, either on a regular schedule or when you get the urge to tell it to do so. It’s a great system in that it allows everyone, from the new computer user to the Web-surfing veteran, to keep their software up-to-date.

Using Software Update

User Level | admin (usually)
Affects | computer
Terminal | no

Although there’s actually a Software Update application located in /System/Library/CoreServices, Software Update is, in a more general sense, a system that Mac OS X uses to check for, and install, updates. You control this system from the Software Update pane of System Preferences—specifically, from the Update Software tab (Figure 4.5). You can choose to manually check for available software updates by clicking the Check Now button, or you can have your Mac do it for you at regular intervals by checking the "Check for updates" box. You then choose an interval (Daily, Weekly, or Monthly) for how often you want the check to be executed. (If your interval comes and goes and you haven’t been connected to the Internet, it will wait until the next time you’re connected.) Whether you choose to check manually or on a schedule, when a check is executed, your Mac will examine the Apple-provided software (OS and applications) installed on your computer and then contact Apple’s software update servers and compare what you have to what’s available. If all of your software is up-to-date, the Software Update preference pane will give you a message to that effect.

Figure 4.5: The Software Update pane of System Preferences
Tip

If you hold down the option key when you click the Software Update pane in System Preferences, Software Update will check for new updates immediately, bypassing the intermediate step. In OS X 10.3 or later, you can also check for new updates immediately by choosing Software Update… from the Apple Menu, or by choosing About This Mac from the Apple Menu and then clicking the Software Update… button.

However, if newer versions of software are available, the Software Update application itself launches and provides you with a list of available updates, including the name of each update, the version number of the software that will be installed by each update, and the size of each update (Figure 4.6). Selecting an update in the box at the top of the window will provide you with details about the update in the lower box.

Figure 4.6: Updates available via the Software Update application

If you want to install an update, check the Install checkbox next to the update name and then click the Install button at the bottom of the window. If multiple updates are listed, you can choose which to install by checking the appropriate checkboxes before you click the Install button.

Tip

If you’re on a dial-up connection, keep an eye on the size of an update in the System Update window. Each update you choose to install must first be downloaded over the Internet, so larger updates will take a long time to complete. If you also have access to a broadband connection, you may want to wait and install larger updates when you’re connected via broadband. If not, you can always connect before you go to bed, or when you’re not going to be using your computer for a bit, and choose to update then.

Another feature added to Software Update in OS X 10.3 and later is the ability to “Download important updates in the background”—an option found in the Software Update pane of System Preferences. If you have both “Check for updates” and this option enabled, when Software Update finds available updates, it will download them to your Mac automatically (storing them in /Library/Packages) and then notify you that they’re ready to be installed. This can be helpful in that you don’t have to manually tell it to download specific files; however, it also means that every update is down- loaded, even those you don’t want. If you’re a modem user, it also means that your slower connection to the Internet will sometimes be at the mercy of Software Update. I recommend this option mainly for people with broadband/high-speed Internet connections who get impatient waiting for Software Update to download updates.

Because most of the updates installed by Software Update are system-related, once you click the Install button, you’ll probably be asked to provide your admin username and password. The update will then be downloaded—you’ll see a progress bar at the bottom of the window letting you know the status of the download—and installed. (You can actually work in other applications while the update is proceeding.) Once the installation is complete, you can quit the Software Update application, unless the update requires that you restart your computer. However, unlike Mac OS 9, under Mac OS X you don’t have to restart immediately; you can switch to other applications and finish your work before restarting.

Tip

In OS X 10.2 and earlier, once you’ve installed an update via Software Update, it’s a good idea to immediately check for new updates again. The reason for this is that some updates require that other updates be installed first; they won’t show up in Software Update until you’ve installed the prerequisite update(s). (In OS X 10.3 and later, Software Update automatically performs this check for you after installing an update.)

As a side benefit, the Software Update pane of System Preferences keeps a record of the updates you’ve installed using the Software Update system. Click the Installed Updates tab to see the complete list. (Note that this list only includes updates you’ve installed via Software Update; it won’t include any updates you downloaded and then installed manually.)

Note

In addition to using Software Update as described here, you can also use it when logged in to your computer remotely or from within Terminal. I’ll show you how to do that in Chapter 11.

Telling Software Update You Don’t Want to Install a Particular Update—Ever

User Level | any
Affects | n/a
Terminal | no

When you check for updates, you’ll often come across an update that you don’t care much about. For example, if you installed support for multiple languages when you first installed Mac OS X, every time a language update is released, it will show up in the Software Update window. This is good if you use the language, but what if you don’t? Why should you have to waste your time (and bandwidth) downloading and installing it? Likewise, if you don’t own an iPod, you probably couldn’t care less about the latest iPod update.

Although being notified of unwanted updates can be annoying, the solution is actually quite easy. Select the update in the Software Update window, and then select Update Ø Ignore Update (Make Inactive in OS X 10.2). To ignore multiple updates, hold down the command key and click each unwanted update to select it, and then choose Ignore Update. After a confirmation dialog (Figure 4.7), the update(s) will vanish, never to bother you again.

Figure 4.7: Ignoring an available update (making it inactive)

Actually, the “inactive” updates are still there; in fact, the next time you go to the Software Update pane of System Preferences, you’ll see a new button that says Reset Ignored Updates, indicating that updates are available but you’ve chosen to ignore them. In addition, if you click the Check Now button, you may see a message that states “Last check: Only ignored updates were available.” If you ever decide you really do want to install one of them, or you just want to see what you’ve hidden, click Reset Ignored Updates; the message will change to “Status: The ignored updates are now available,” and the next time Software Update checks for updates they will appear again.

Note

In OS X 10.2 (Jaguar), if you make any updates inactive, you’ll see the text “Inactive Updates: #” with the number of updates you’ve chosen to hide in the lower-right corner of the Software Update window. Select Update Ø Show Inactive Updates, and they’ll once again be visible. To make an inactive update “active” again (so that you can install it), select it and then select Update Ø Make Active.

Saving/Downloading a Software Update for Future Use

User Level | any
Affects | n/a
Terminal | no

Although Software Update is a convenient and easy-to-use system, some people just don’t like automatic installations; these manual types (and I admit that sometimes I’m one of them) would rather download the updater on their own and do the installation themselves. In addition, some people (and I’m definitely one of these) like to have an archive of updates (on CD or a removable volume) that they can keep handy in case they ever need to reinstall something or update another Mac without having to access the Internet. These groups of people might choose to go to Apple’s software updates website (http://www.info.apple.com/support/downloads.html) and download updates manually.

This approach has two problems. The first is that software updates are usually available via Software Update at least a few days, and sometimes weeks, earlier than via Apple’s website. The second is that although Software Update only lists updates that are appropriate for your particular computer, Apple’s website lists every update available for any computer with any version of the Mac OS. In other words, knowing which ones to download isn’t always easy.

Thankfully for both groups of people, you can use Software Update to download updates right away, without even needing to install them, and to only get those that are needed by your computer. And it’s very easy to do. You just check for updates using Software Update as you normally would; the Software Update application will launch and show you the list of available updates. To download an update (or multiple updates) manually, check the install box(es) for the update(s), but instead of clicking Install, select Update Ø Download Only (“Download Checked Items to Desktop” in OS X 10.2 or earlier). Software Update will download the update(s) normally, but instead of installing them, it will save the selected update(s) to /Library/Packages (or, in OS X 10.2 or earlier, the Desk- top of the current user). The Status of each downloaded update will be listed as "Downloaded at /Library/Packages" (or "Not installed, downloaded" in OS X 10.2 or earlier). You can still install the update via Software Update, but now you also have a copy on your hard drive.

In OS X 10.3 (Panther) and later, you also have the Update Ø Install and Keep Package option. This option combines the standard install option with the download option—the update is down- loaded and installed, but the installer package is saved in /Library/Packages for you. This is actually the option I use most frequently.

Note

In OS X 10.2 and later, you can only use the download feature of Software Update on updates that haven’t yet been installed. Once you install an update, it’ll no longer appear in the Software Update window. If you happen to be using Mac OS X 10.1.x, you actually download an update after you install it (by selecting it and choosing Update Ø Save As…).

Start Sidebar
“Software Update” for Third-Party Software?

If you think Software Update is a godsend for keeping your OS and Apple-provided software up-to-date, you may also appreciate the various services that perform similar functions for third-party software. These services generally use a system similar to Software Update: an application that runs on your Mac inventories all the software installed on your computer, and then periodically connects to a central database over the Internet to see if newer versions of your installed software are available. You can then choose to download and/or install the updates.

The most popular update services for Mac OS X are VersionTracker Pro (http://www.versiontracker.com/) and UpdateRadar (http://www.ricciadams.com/programs/updateradar/, currently only for OS X 10.2). They work a bit differently, but both provide similar functionality. Explore the features of each to see which is better for you. In addition, a new system called MacPAD (http://macshareware.net/) looks to help developers notify the users of their software when a new version is released.

As a side note, if you open the file /System/Library/CoreServices/ Software Update.app/Contents/Resources/English.lproj/ Localizable.strings in your favorite text editor, there are references to 1-Click ordering and .Mac software discounts. I may be reading too much into this, but it makes me think that perhaps by the time you read this, or soon after, Apple may be selling software via the Apple Store Online and then letting you download your purchases via Software Update. Stay tuned!

End Sidebar

One advantage of having an archive of update installer packages is that if for some reason an update fails, or you need to reinstall an update, Software Update won’t be able to help—once you install something from Software Update, it won’t be available for reinstallation. However, if you have a copy of the update installer package available, you can manually install the update yourself by double-clicking it in the Finder (which will launch the Installer utility).

Installing Apple Software Updates Manually

There are times you may need to (or want to) install Apple software updates from downloaded update installers or installer packages rather than via Software Update. Installing these updates manually works just like installing any other software manually—you just double-click the installer package or installer application and follow the instructions. However, unlike some third-party software installers, you’re rarely given an option to choose where Apple software and updates are installed. In addition, one caveat you need to keep in mind when installing Apple updates manually is that they often must be installed in a certain order.

Note

One interesting quirk of installing Apple updates from a downloaded update package is that they require much less free space on your startup volume than installing the same updates via Software Update. If your hard drive is getting low on space, some larger updates may not be installable via Software Update but will install without a hitch using the downloaded update package.

Tip

I recommend installing updates to Mac OS X itself when your Mac is actually booted from the copy of OS X you’re updating. Updating a copy of Mac OS X located on a non-boot volume can result in Apple-installed applications not being updated properly.

In What Order Do I Install Updates?

One disadvantage to installing updates manually—especially updates to the OS itself—is that if you have multiple updates to install, it’s often difficult to figure out which should be installed first, second, etc. Order can be very important because later updates often require software installed by earlier ones in order to update successfully (and they often give no warning when they aren’t successful).

When you use Software Update, the issue of update order is taken care of automatically. However, if you’re not using Software Update, you have to figure it out on your own. One way to do so is to use the Finder’s Get Info command on update packages and installers in the Finder (not disk image files, but the packages and installers contained in the disk images). You can often figure out when an update was released by looking at its Modified date and then use those dates to figure out the order to install updates (oldest first, newest last).

Unfortunately, for those updates that aren’t provided on disk images (those downloaded directly as packages or installer applications), some Web browsers set the Modified date as the date of down- load. Fortunately, Apple has provided a few Web pages that list the available updates to each major version of OS X:

  • Mac OS X 10.3: http://docs.info.apple.com/article.html?artnum=25633

  • Mac OS X 10.2: http://docs.info.apple.com/article.html?artnum=75421

  • Mac OS X 10.1: http://docs.info.apple.com/article.html?artnum=106713 (This page also includes updates to Mac OS X 10.1 applications.)

Start Sidebar
Panther vs. Jaguar: Installing Saved Updates

I mentioned in the main text that you can download Apple-provided software updates—via the Web or Software Update’s download function—and use them at a later time or on another Mac. The problem with this approach is that whereas Software Update can install multiple updates all at once, even if more than one would normally require a restart when installed separately, when you download packages and install them manually it appears as though you need to restart after each update.

I say appears because this isn’t really the case. In both OS X 10.3 (Panther) and OS X 10.2 (Jaguar), there are ways around this requirement. However, the method differs depending on which version of the OS you’re running.

In Jaguar, you simply need to place all of the downloaded installer packages on the Desktop of the admin user who is currently logged in and then launch Software Update. Any updates that haven’t yet been installed will be listed in the Software Update window; check the ones you want to install, and click the Install button. Software Update will recognize that they’ve already been downloaded and will install them immediately.

Unfortunately, this trick doesn’t work in Panther. However, what you can do is use Software Update to see which updates are needed and then locate those update packages on your drive. Open all of the packages at once (by double-clicking each of them, one at a time, or by selecting them all in the Finder and either choosing File Ø Open or pressing command+O). The OS X Installer utility will launch once, but it will open a separate installer window for each update. You’ll need to manually click through the various screens of each Installer window, but after that Installer will take care of the rest. If one of the updates tells you that you need to restart, you can simply ignore it until all of the updates have finished. Once all of the updates have completed, then you can restart, if necessary.

End Sidebar

Restoring Selected Software and Installing Parts of Updates

There are times when you may need to “get back” some of the software that came with your Mac. Or you may need to get a copy of a single file or group of files installed by the OS X Install CD/DVD or by an updater. In any of these cases, you’re trying to restore software or get it from a source that generally makes retrieval difficult. The following are a few procedures you can use to get the software you need, depending on what exactly it is you’re trying to get.

Using Software Restore CDs/DVD to Restore Selected Software

User Level | admin
Affects | computer
Terminal | no

Every Mac manufactured in the past few years has included a set of Software Restore CDs (or a DVD). These discs are designed to allow the user to restore their hard drive to the original, “factory- fresh” state. (The instructions on how to do this are included on the Software Restore discs themselves, so I won’t go into that here.) But what if you don’t want to erase your hard drive and start over? What if you just need a copy of iDVD because you accidentally deleted the copy you had? It’s actually not too difficult, especially if your computer came with OSX pre-installed.

If Your Computer Shipped with OS X 10.2 or Later Installed

If your computer is one of the Macs that shipped with OS X 10.2 or later pre-installed, you’re lucky, because the version of Software Restore that comes with these computers is much better than the one that came with older computers—for two main reasons. First, and most important, it doesn’t require you to erase your entire hard drive. And second, you can tell it exactly which applications or files you want to restore; you don’t have to install everything.

Using this version of Software Restore is quite simple and rather self-explanatory. You boot up normally, insert the first Software Restore CD (or the DVD, if applicable), and launch the Software Restore application on the disc. You’re given the option to install everything, or to just install certain items; once you decide what to install, it installs your choices. If you’ve installed anything that requires you to restart, you do so; after that, you’re done. Simple. Unfortunately, not everyone has this version of Software Restore.

If Your Computer Shipped with an Earlier Version of the Mac OS

If your computer didn’t ship with OS X 10.2 or later installed, that means it came with either Mac OS X 10.1 or an earlier version of the Mac OS, and you purchased and installed 10.2 or later yourself. (I’m assuming you’re using 10.2 or 10.3 by this time.) In this case, the Software Restore CDs that came with your computer are much more limited than the ones previously described. On these CDs, Software Restore has only a single mode of operation: Erase your hard drive and restore everything that was on the hard drive when your computer was new. Clearly this isn’t a great solution, especially if you just want to restore a single application or a few desktop patterns. Luckily there’s a way to retrieve selected files or applications:

  1. Make sure your hard drive has 2–3 GB of free space available (if it doesn’t, you can’t use this procedure).

  2. Create a new folder on your computer (the Desktop is a convenient location), and name it something relevant, such as Restore Software.

  3. You should have a set of Software Restore CDs (generally three or four); insert the first CD. (Make sure you’re using the Software Restore CDs, not the Software Install CDs.)

  4. Open the Configurations folder on the CD. Inside, you’ll find a disk image; copy that image to the folder on your computer.

  5. Repeat this procedure for each Software Restore CD. Each will have a disk image inside the Configurations folder; copy all of these disk images to your hard drive (they must all be copied to the same location).

  6. Depending on whether you’re running OS X 10.2 or 10.3, do one of the following:

    • If you’re running OS X 10.3, launch Disk Utility (/Applications/Utilities/Disk Utility). Drag the first disk image (Disc 1) into the list of volumes on the left side of the Disk Utility window; then select it from the list and click the Open button in the toolbar. This will mount the disk image on the Desktop (and/or in the Finder sidebar); it will most likely be named Macintosh HD.

    • If you’re running OS X 10.2, launch the Disk Copy utility (/Applications/Utilities/Disk Copy). Drag the first disk image (Disc 1) onto the Disk Copy window or onto the Disk Copy icon in the Dock (you can tell Disk Copy to skip the "checksumming" stage). This will mount the disk image on the Desktop; it will most likely be named Macintosh HD.

  7. Open the mounted volume and find the software you want to retrieve. Simply drag it from the disk image to the appropriate place on your hard drive.

  8. Unmount the disk image by dragging it to the Trash (or selecting it and selecting File Ø Eject).

  9. After you’re finished, you should run the Repair Disk Permissions feature of Disk Utility as described in Chapter 1. The reason is that when Mac OS X is installed, system-related files and applications are given specific permissions. When you copy files over manually, the permissions are often not set correctly. Running Repair Disk Permissions ensures that permissions are set correctly.

Warning

If your Mac shipped with an earlier version of the Mac OS (OS 9, Mac OS X 10.1, etc.), and you later installed a newer version, you should not use this method to retrieve files or applications that were updated by the newer version of the Mac OS. For example, if your Mac came with Mac OS X 10.2, and you later purchased and installed OS X 10.3, don’t use this method to get a copy of iTunes or TextEdit. You should instead read the next section, “Installing Parts of an Update, System, or Software Install,” to get the version of iTunes or TextEdit that came with OS X 10.3. You can still use the procedure described above to get third-party software, such as a game or other application, that originally came with your computer but isn’t part of your current version of OS X.

Installing Parts of an Update, System, or Software Install

What if your computer didn’t come with OS X 10.2 or later (i.e., you bought the OS and installed it yourself) and you want to reinstall an application or file installed with the newer OS? In this case you wouldn’t be able to use the procedures described in the previous sections, because your Software Restore CDs (or DVD) don’t contain the newer version. Or, what if you want to reinstall a single file or package from the Mac OS 10.3.1 updater (such as the Terminal application package) or a file from some other installer package? Or, what if you want to reinstall a particular part of OS X (such as printer drivers) without having to run the entire installer?

Many of these types of files are located inside installer packages of the type I discussed earlier in this chapter. In fact, the Mac OS X installer itself is actually many different installer packages grouped together for installation. It’s possible to use the Show Package Contents feature of the Finder to browse the contents of an installer package, but without knowing where to look, where to install the pieces, and how to properly set permissions, this isn’t a very easy task.

Luckily, third-party developers provide solutions to this dilemma. A number of utilities are currently available for working with packages, including OS X Package Manager, ReViewPkg, and Pacifist. Pacifist (http://www.charlessoft.com/) is my current favorite. By dragging an installer package onto the application’s icon (or the Pacifist window if it’s already running), Pacifist presents you with a list of software included in the package and gives you the option of installing individual items.

This is a good place to provide an example of what you can do with Pacifist. I mentioned earlier in the chapter that if you move any of Apple’s OS X applications from their original location, Apple’s Mac OS X updaters won’t update these applications correctly. When I installed OS X 10.3, I accidentally moved the Terminal application inside another folder. When I used the Mac OS X 10.3.1 updater, it was unable to update Terminal. So I was left with Mac OS X 10.3.1, except for Terminal, which was still stuck at an older version. I could have moved the Terminal application package to the proper location and run the entire OS updater again, but an easier solution was to use Pacifist to update just Terminal. Here’s how to do it:

  1. Launch Pacifist.

  2. Mount the Mac OS X 10.3.1 Update disk image in the Finder. (If you have the installer package itself on your hard drive—for example, if you downloaded it via Software Update—you can skip this step.)

  3. Drag the MacOSXUpdate10.3.1.pkg package onto the Pacifist window.

  4. Pacifist will present you with a list of the package’s contents; click the disclosure triangle next to Applications to see the applications contained in the package. You’ll see Terminal.app as one of the options (Figure 4.8).

    Click To expand
    Figure 4.8: The contents of the Mac OS X 10.3.1 updater package as viewed in Pacifist

  5. Select Terminal.app. If you click the Show Info button, you’ll see some information about the Terminal application, including where it will be installed and the permissions that will be set for it.

  6. Click the Install button to install the Terminal application in its default location. Pacifist will confirm the action and then ask you for an admin username and password. (You can instead choose to save the application elsewhere, using the Extract To… button, but I recommend using the Install command.)

  7. Pacifist will most likely present a dialog telling you that Terminal already exists and asking you what to do: stop, leave the original application alone, replace it, or update it. Click the Update button and Pacifist will update the Terminal application. (If I had instead been extracting the full Terminal application from the OSX installer discs, I would have clicked the Replace button. If no previous version existed, or the older copy of Terminal was still in the wrong location, I wouldn’t have seen this particular dialog; Pacifist would have simply installed the application.)

Note

If you want to extract/install items from the Mac OSX installer CDs or DVD, when you open the disc in the Finder it may appear as though there are no packages on it. The reason for this is that all of the installer packages are located in a hidden folder on the CD or DVD, /Volumes/discname/System/Installation/Packages (where discname is the name of the CD or DVD as it appears in the Finder). You can get to this folder by selecting Go Ø Go to Folder… in the Finder and typing in that path. You can then drag individual packages onto Pacifist to view the files installed by each. (Most of the key System-level files are contained in BaseSystem.pkg and Essentials.pkg.)

Updating/Reinstalling the Entire OS: Archive and Install

User Level | admin
Affects | computer
Terminal | no

If you buy a new Mac, it usually comes with the latest full version of Mac OS X pre-installed (e.g., OS X 10.3). If you want to install Mac OS X on a new hard drive, you just insert the OS X Install CD or DVD, run the installer application, and select the new hard drive when asked for the installation destination.

However, what if you want to install a newer version of OS X over an existing Mac OS X installation (e.g., OS X 10.3 over version 10.2 or earlier)? The OS X installer includes an “upgrade” option that installs the newer version over the top of the current version, but many users have reported problems when using this option; if your current installation has any problems, those problems will likely still exist, and possibly be worsened, by installing a newer OS X over it. Or, what if you’re having serious problems with your current OS X installation and want to just reinstall and start over again? Chances are you’ve got accounts, personal data, and preferences that you don’t want to lose.

The installers for Mac OS 9 and earlier provided users with the option of a “clean install”—a new System Folder was installed, but your previous System Folder was preserved. This was considered a good way to get a “safe” system and then gradually transfer over any preference files and system addons, rather than simply dumping a new system on top of an older one (especially bad when the old system was having problems). Users of Mac OS X waited a long time to get similar functionality, and OS X 10.2 and later finally provide it—and do it one better.

OS X’s version of the clean install is called Archive and Install and is available from the OS X installer’s Options dialog (Figure 4.9). (To access the Options dialog, immediately after you’ve chosen a destination for installation—presumably a volume that already has OS X on it—click the Options… button at the bottom of the installer window.) When you choose the Archive and Install option, all of the files from your existing OS X installation (whatever the version of that installation may be) are moved into a new folder at the root level of your hard drive called Previous Systems. OS X is then installed as if the hard drive has no operating system. In addition, the installer moves any third-party applications that you had previously installed into the new /Applications directory, saving you the trouble of rein- stalling them.

Figure 4.9: The Archive and Install option of OS X 10.2 and later
Note

The Archive and Install option is available from all “full” install CDs for OS X 10.2 and later. However, it isn’t available from the OS X 10.2 Update CDs—the free update CDs Apple provided to users who bought a new Mac or a copy of OS X 10.2 after 10.2 was announced but before it was available. I’ve seen mentions on the Web of a procedure (unsanctioned by Apple) to turn these update CDs into a standard installer that provides these options, but apart from this “hack,” users with update CDs that don’t provide access to the Options dialog will have to simply use the Update install.

A second option, called Preserve Users and Network Settings, is where the newer installer really shines. This option retains all of your user accounts, files, and settings, as well as your system-wide network, Internet, and dial-up settings. When the installation is complete, you can restart your computer and boot into your new copy of OS X without missing a beat. The login screen will appear with all of your user accounts available, and you can connect to the Internet immediately upon logging in.

If you’re reinstalling OS X 10.2 or later, or installing it over a previous version of Mac OS X, I highly recommend these two options, as such an installation will likely be more stable than an Update install and will get you up and running much faster than the Erase and Install option, or even just the Archive and Install option (which would require you to set up all of your accounts and network settings).

Tip

The Archive and Install option is also useful for “downgrading” your OS X installation. For example, if you install an update to OS X that ends up causing problems, you can’t easily “go back” to the previous version. You can use Archive and Install (with the Preserve Users and Network Settings option enabled) to reinstall an older version of OS X and then update to the latest version before the problem update.

There are a few minor caveats to an Archive and Install. The first is that a few settings, listed at http://docs.info.apple.com/article.html?artnum=25454 aren’t preserved; however, it’s pretty easy to set them again. The second is that a few system add-ons and support files may not be transferred to your newly installed OS from the old one, so you may want to do a bit of "cleaning up" to get your Mac running as it was before the install. I cover this procedure in the next section. Finally, a few applications—especially certain "Pro" apps from Apple—simply won’t work after using the Archive and Install procedure and will need to be reinstalled. Apple has provided more information about these applications at http://docs.info.apple.com/article.html?artnum=93392.

Restoring Other Files after an Archive and Install

User Level | admin
Affects | computer
Terminal | no

Although the Archive and Install procedure preserves your user accounts and network settings, and even your installed applications, a good number of system-wide (“local”-level) files don’t get transferred over to your new installation of OS X. You may want or need some of these if you want your new system to have the same functionality as your old system. Some examples are system-wide addons and plug-ins and application support files.

At the root level of your hard drive, you’ll find a folder called Previous Systems. If you open this folder, you’ll find a sub-folder called Previous System 1 (or 2, or 3, etc., if you’ve performed multiple Archive and Install installations) with contents that mirror the files and folders at the root level of your hard drive: Applications, etc., Library, mach, mach.sym, System, Users, and var; you may also have a folder called Developer if you installed Apple’s Developer Tools. These files and folders are simply the previous operating system on your hard drive—your old Mac OS X. Although you’ll eventually throw many of the files inside these folders away, some are things you may want to transfer over to their corresponding locations in your new installation of OS X. Use the following guidelines to decide what to move from the Previous Systems # folder to the corresponding location in your new OS X installation (and what not to move).

If you attempt to move a file or folder from your “Previous” system to your new OS X installation and you get an error that you don’t have the right privileges, you may need to use the Finder’s Get Info command to change the ownership and/or permissions for the item (as described in Chapter 1). Just be sure that after you move the item, you change its privileges back to their original values. An easier way to move restricted files without changing permissions is to use a utility such as SkyTag Software’s File Buddy (http://skytag.com/filebuddy/), which allows you to move files and folders using root/admin access.

Note that if you’ve performed multiple Archive and Install procedures on your hard drive, you’ll have multiple Previous System folders, numbered 1, 2, 3, and so on; the one with the highest number is the newest and is the one on which you should focus your attention.

Note

If you want to ensure that you have the “cleanest” possible upgrade, you can skip this section until you find a missing feature or setting. You can then use the tips here to help you find the specific file(s) to transfer.

mach, mach.sym, mach_kernel Some or all of these files have been replaced by updated versions, depending on the OS version; you can safely ignore them.

Developer If you’re upgrading from an earlier version of Mac OS X, the developer support files in this folder aren’t compatible with the newer version of OS X you just installed; you should leave this folder and its contents here. If you’re reinstalling the same version of OS X, you can either move the “Previous” Developer folder to the root level of your hard drive or leave it here and install a fresh copy of the Developer Tools/Xcode Tools.

Applications Almost all of your previously installed applications and utilities have been moved from this folder to the new Applications folder at the root level of your hard drive. In fact, the only files you should find inside this folder are older versions of Apple-provided applications, all of which have been replaced by newer versions in the new Applications folder. The same is true of the Utilities sub-folder. The lone exception is if you had previously moved files or folders inside the AppleScript folder under your previous Mac OS X installation; if you did, they’ll still be inside the archived AppleScript folder, and you’ll need to manually move them to the new Applications folder.

Users As explained previously, the OS X installer moves all user folders from the archived Users folder to the new OS X Users directory—unless you performed an Archive and Install using the OS X 10.2 install CDs. In this particular case, the Shared user folder doesn’t get transferred. If you had previously placed files in the Shared user folder, you’ll need to manually move them from the archived Shared folder to the Shared user folder in your new Users directory. (Make sure you copy the contents of the folder and not the entire folder.) If you’ve installed OS X 10.3 or later, the Archive and Install procedure correctly moves the Shared folder to the new Users folder for you.

Library This is the most complex folder to deal with because of the mix of older Apple-installed files that you don’t want to transfer over and newer user- or application-installed files that you do. Luckily, the OS X installer moves a few important files for you. Specifically, it moves the Application Support and iTunes folders, as well as the contents of the Preferences folder, into the new /Library folder.

However, many applications install other support files in this folder, and other system add-ons, such as contextual menu plug-ins, browser plug-ins, and Services, are installed here for systemwide use. If you decide to manually reinstall applications, support files, and third-party add-ons from scratch (some people do), then you can ignore this folder. However, if you want to retain the full functionality of your previously installed software without reinstalling everything, going through this folder is the only way to do it. (Note that because of privilege issues, when you drag files from the archived Library folder to the new Library folder, some files will copy while others will be moved; this is normal.)

The first step is to look for any files and folders that exist in the archived Library folder that don’t exist in the new Library folder. (A common example is StartupItems.) It’s safe to simply drag these over wholesale.

Dealing with the rest of the folder is a bit more tedious. You’ll need to open the new Library folder and the archived Library folder side by side and compare the contents of each sub-folder. Files that exist in the old Library but don’t exist in the new one can generally be moved over—some examples are individual fonts, Internet Plug-Ins, preference panes, and screen savers. (Although you should check with the developers of any third-party preference panes first to make sure they’re compatible with the new version of OS X you just installed.) On the other hand, don’t replace files or folders that already exist in the new folder—chances are these are newer versions—without first checking the version numbers and/or creation dates on each (using the Finder’s Get Info command). Chances are you want the newer version to be in your new Library folder.

A few folders warrant special consideration:

  • Don’t transfer the contents of /Library/Caches from the archive to the new /Library. OS X will re-create these files as needed.

  • Before you transfer any files from the old /Library/Printers folder to the new one, try setting up your printer in the new version of OS X—there’s a good chance support for your printer already exists. One exception is if you had previously installed FaxSTF, in which case you should transfer over the /Library/Printers/SmithMicro folder.

  • In the /Library/Receipts archive, copy only receipts that were clearly installed by third- party software (e.g., FaxSTF, Windows Media Player, etc.). If you’re unsure about an item, leave it—these aren’t vital.

  • If you were previously running a Web server off your Mac via Personal Web Sharing but were using the system-level Web directory rather than your user-level Sites folder, be sure to transfer any custom contents of the old /Library/WebServer/Documents folder to the new one.

If you just installed Mac OS X 10.3 or later over OS X 10.2, the following tip is for you:

  • In OS X 10.3, Apple has removed a few available login pictures. If you want to make sure you still have all of the older pictures, move the folder called X Images from the archived /Library/User Pictures folder to the new one. Likewise, if you had previously added your own pictures to this folder to make them available as login pictures, you should move them to the new User Pictures folder.

If you just installed Mac OS X 10.2 or later over a version of OS X prior to 10.2, the following two tips also apply:

  • The folder /Library/ColorSync/Scripts in the archive corresponds to the new directory /Library/Scripts/ColorSync.

  • In OS X 10.2 and later, Apple has replaced some of the available login pictures with new ones. If you’d like to retain all of the pictures from Mac OS X 10.1.x, make sure you move the appropriate files and folders—specifically the Cheetah and Orangutan files and the Landscapes and X Images folders—from the old /Library/User Pictures folder to the new one. Likewise, if you had previously added your own pictures to this folder to make them available as login pictures, you should move them to the new User Pictures folder.

System You can largely ignore this folder, because it’s rarely modified by users or applications and the new System directory at the root level of your hard drive contains newer versions of almost everything. One exception occurs if you had previously customized sendmail (Mac OS X’s built-in Unix mail server); if so, carefully check the contents of the archived /System/Library/StartupItems/Sendmail folder. You may need to move some of these files over (and you’ll probably need to change permissions, or use File Buddy or another utility, to do it). However, if you’ve just installed OS X 10.3 or later, note that Apple has replaced sendmail with the postfix mail server package, so you may want to start anew instead using postfix.

etc and var These two “folders” are actually aliases to folders within the invisible /private directory in your archived OS X folder. Most users can safely ignore them. However, for a few users (you’ll know if you’re one of them), there’s important information contained in a few subfolders:

/etc/crontab This file is the system-level cron schedule (crontab); if you’ve made changes to it, you’ll want to transfer it.

/etc/cups If you’ve manually configured settings for CUPS, OS X’s printing system (discussed in Chapter 12), a number of files in this folder may be important.

/etc/hostconfig If you’ve set up sendmail on your Mac, this file is important. (Although, as I mentioned earlier, if you’ve just installed OS X 10.3, postfix has replaced sendmail as the preferred mail server.)

/etc/httpd/httpd.conf If you’ve manually edited your Apache (Web server) configuration, you’ll want to transfer this file. (Note that beginning with OS X 10.2.5, if the OS X Installer sees that you’ve modified the httpd.conf file, it moves the modified copy to your new /etc/httpd directory and then creates a new copy named httpd.conf.default. You can continue to use your older edited copy, or you can re-create your custom edits in the new file and rename it httpd.conf, replacing the old copy.)

/var/cron/tabs If you, or any users of your Mac, have edited their personal cron schedules (crontabs), you’ll want to transfer this folder.

/var/log This folder contains archives of system-level log files. If they’re valuable to you, copy them. (You actually don’t need to move them to the new /var/log directory; since they won’t be used by the new version of OS X, you can move them wherever is convenient for you.)

/var/mail Again, if you had previously set up sendmail on your Mac, the contents of this folder are important.

/var/root If you previously enabled the root user in Mac OS X, this is the root user’s "home" folder and contains the Desktop, Documents, and user-level Library directories (as well as any other files/folders that may have been created or saved to the "home" folder when logged in as root).

Note

If you don’t see the etc or var folders inside your Previous System # folder, you can locate them by opening the folder called private at the root level of the Previous System # folder.

Kernel extensions One particular type of file that the OS X installer never moves into your new installation of OS X is kernel extensions (located in /System/Library/Extensions). And for good reason; because they interact with the OS at a very low level, incompatibilities can cause major problems. Most kernel extensions are installed as part of a software package that affects your Mac’s functionality. A few examples are USB Overdrive, Kensington Mouseworks, Griffin PowerMate, and other utilities that affect input devices. If you’re not sure which kernel extensions to move over, a safer approach is to simply reinstall them using the original installer. (In fact, this is a good opportunity to check with each developer/manufacturer to see if an updated version is available.)

Other (invisible) folders There are also a few invisible folders—bin, sbin, usr—located in your Previous Systems # folder. These contain Unix applications and support files. If you’ve never delved into OS X’s Unix underbelly, you can safely ignore these folders. However, if you’ve installed Unix software packages (such as MySQL, CVS, or even IBM’s ViaVoice), there may be files here, especially in the /usr/local directory, that didn’t get automatically moved over to the corresponding folders in your new OS X installation. Chances are if you’re using such software, you know how to transfer it over. If you don’t know how, you can simply reinstall it under the new OS.

Once you’ve used these guidelines to transfer files from the archived system to your new OS X installation, it’s a good idea to restart your computer and then log in. You’ll need to set up your printer(s) again, but apart from that there should be minimal additional setup necessary. Once your Mac has been running smoothly for a few days, you can delete the Previous Systems folder and its contents; note that some of the remaining files may have permissions that require you to authenticate when you attempt to delete the folder. (If you just installed OS X 10.2, to delete the Previous Systems folder, select it in the Finder and use the Get Info command to give yourself read and write privileges. Click the “Apply to Enclosed Items…” button to change the permissions of everything inside the folder. You can now drag it to the Trash.)

Note

If you installed a newer version of OS X over an older version, it’s possible that some of your older software doesn’t work with the new OS. If one of these incompatible applications was previously set up as a user-level Login/Startup Item, it will launch at login just as it did before, which can cause problems. If this happens to you, log out and/or restart and then log in again, but this time press the shift key just after the login/startup screen and hold it down until after the Finder loads. This will prevent all user-level Login/Startup Item from loading. You can then remove the offending Login/Startup Item from the Accounts pane of System Preferences (or from the Login Items pane of System Preferences in 10.2) and then log out and back in.

After installing Mac OS X, especially when you’ve performed an Archive and Install, it’s a good idea to run the Repair Disk Permissions feature of Disk Utility to ensure that all system-level files have the correct privileges.

Note

If you’re reinstalling OS X using older Install CDs/DVD, remember to also reinstall any updates to OS X that have been released since your CDs/DVD most likely won’t install the latest version.

Forcing Apple Setup to (Re)Run after an OS Install

User Level | admin
Affects | computer
Terminal | yes

The first time you start up your Mac in OS X, the Apple Setup utility begins and walks you through the setup process. Afterward, you never see it again. However, if you’ve reinstalled the entire OS and want it to run to make setup a bit easier, here’s the quick and dirty solution: Launch Terminal, and then type sudo rm /private/var/db/.AppleSetupDone <RETURN>. Restart your Mac, and the Apple Setup Utility will run at startup.

Reinstalling Mac OS 9 for the Classic Environment

User Level | any
Affects | computer
Terminal | no

If you should ever need to reinstall a copy of Mac OS 9 for use in the Classic environment—perhaps your current copy is having problems, and you just want to erase it and start over—it’s actually quite easy, provided you have a copy to install.

If you have an older Mac that came with Mac OS 9, or another partition or hard drive that contains OS 9, you can just copy the Mac OS 9 System Folder to your OS X computer (provided it is OS 9.2.x or later, as discussed in Chapter 8).

If you don’t have a copy of OS 9 on a drive somewhere, the easiest way to get it is from the Software Restore CD/DVD that came with your Mac. Use the following steps to do so:

  1. Insert the Software Restore CD or DVD.

  2. In the Finder, choose Go Ø Go to Folder….

  3. In the Go to Folder box, type /Volumes/discname/.images and press return. This will open the invisible .images folder on the disc, which contains disk images of all the non-OS X software that came with your Mac.

  4. Double-click the file called OS9General.dmg to mount it in the Finder.

  5. Drag the OS 9 System Folder from the mounted image to your hard drive.

Note

If for some reason you aren’t able to install a fresh copy of Mac OS 9 using either of the techniques provided here, Apple provides a slightly different procedure at http://docs.info.apple.com/ article.html?artnum=107383.


Uninstalling Software

At some point you’ll want to remove software that you’ve installed. You may have tried out some software that you didn’t like, or you may want to free up some disk space or clean up some clutter. Whatever the reason, uninstalling software is one of those tasks that everyone ends up doing at some point. The following sections show you how to do it right.

Uninstalling Mac OS Software

It’s rare that you’d want to uninstall part of the Mac OS; more important, it’s generally not a good idea. However, OS X installs a few things by default, such as language files, that you may not want or need. In addition, if you’ve installed the OS X Developer Tools/Xcode Tools, you may decide down the line that you no longer want them (because they take up quite a bit of space). The following sections show you how to get rid of them.

Removing Unwanted Language Support

User Level | admin
Affects | computer
Terminal | no

Unless you specifically tell the OS X installer not to, it will install support for a wide range of languages (often called localization support); likewise, if your Mac came with OS X, these language support files were already installed. In addition, many applications, both from Apple and from third-party developers, include localization resources. Although it’s neat that your computer supports so many languages, if you’re like most people, you probably use only one, or perhaps two. (If you’re multilingual enough to actually use your Mac with multiple languages, I envy you. Seriously.) Yet these language support files take up hundreds of megabytes of space on your hard drive—sometimes more than a gigabyte.

You can regain this space by removing language support files for languages you never use. It’s possible to do this using Terminal, but it’s much easier to use one of the many utilities that have sprung up since Mac OS X was released. My favorite is the freeware DeLocalizer (http://www.bombich.com/software/local.html), but the sponsorware Monolingual (http://homepage.mac.com/jschrier/) is quite similar. (Neither has been officially updated for use with OS X 10.3; however, many users have reported success, and, in fact, there’s little difference between OS X 10.2 and 10.3 in this regard.) Launch DeLocalizer, and you’re presented with a list of languages supported by Mac OS X (including non-American English variants) (Figure 4.10); check the boxes next to those you want to remove, and then click the Clean button. (By default, DeLocalizer only "cleans" the startup volume; if you want it to delocalize other mounted volumes, uncheck the "Startup disk only" box.) You’ll be asked for an admin username and password, after which the chosen localization files will be removed from your hard drive. (DeLocalizer removes both OS- level language support and application-specific localization files.)

Warning

If you want to get system-level localization files back, either you need to use a utility like Pacifist, as described earlier in this chapter, or you need to reinstall OS X. To get application-level localization files back, you’ll generally need to reinstall the affected application(s). So be sure you really want to remove these files!

Removing the OS X Developer Tools/Xcode Tools

User Level | admin
Affects | computer
Terminal | yes

I recommended in the Introduction to the book that you install the Mac OS X Developer Tools (also called Xcode Tools under OS X 10.3), as some of those tools are useful for some of the exercises in this book. However, if you ever decide you want to get rid of them, you can’t just throw away the /Developer folder; the Developer Tools/Xcode Tools installer actually installs files in several other locations on your hard drive. Luckily, one of the files inside the /Developer folder is a script that uninstalls all developer-related files. To run the script, launch Terminal and type sudo /Developer/ Tools/uninstall-devtools.pl <RETURN>. Enter your password when prompted, and the script will do the rest.

Uninstalling Third-Party Software

You can uninstall most third-party software without consequence. However, some software is easier to uninstall than others. The following are a few methods for removing software, easiest first. Besides deleting the software itself, most applications and system add-ons also create preference files— usually with the name of the software in their name—in either /Library/Preferences or ~/Library Preferences. Although it won’t do you any harm to keep these files, you can delete them if you want to completely remove any trace of a piece of software.

Manually Deleting Software

User Level | normal or admin
Affects | user or computer
Terminal | no

If a particular piece of software was installed via drag-and-drop, chances are it can be removed via drag-and-drop (as in, drag it out of its folder and drop it onto the Trash in the Dock). If the software was installed by an admin user into /Applications, /Library, or another system-level directory, only an admin will be able to delete it; if the software was installed by a user into the user’s home directory, only that user will be able to delete it.

Figure 4.10: DeLocalizer lets you remove unwanted language support

Removing Software Using an Uninstaller or the Original Installer

User Level | normal or admin
Affects | user or computer
Terminal | no

Some software developers are kind enough to provide an uninstaller with their software. An uninstaller is simply an application that removes all traces of a particular software title. Uninstallers make it extremely easy to remove software if you decide you don’t like it or no longer want it.

Similarly, some third-party software installers actually have an uninstall option. To see if a particular software installer has such an option, launch the installer as if you were going to install the software in question. When you get to the screen with the Install button—which would normally install the software—press the option key. If the Install button changes to Uninstall, the installer has an uninstall option; clicking Uninstall should remove the software from your Mac.

Uninstalling Packages Using DesInstaller

User Level | admin
Affects | computer
Terminal | no

I discussed installer packages earlier in this chapter. In addition to being a convenient way to install packages, most well-behaved installer packages also leave behind a “guide” to make removing them easier, in the form of an installation receipt in /Library/Receipts. All you need to take advantage of this receipt is a package uninstaller such as DesInstaller (http://krugazor.free.fr/ software/desinstaller/DesInstaller.php) that can read these receipts.

When you launch DesInstaller, you’re presented with an empty window with five buttons; click the leftmost button to list all the installed packages in the DesInstaller window. (Unfortunately, Des- Installer’s buttons aren’t labeled very well, but you can reveal a button’s function by holding the cursor over it for a few seconds; a text label will pop up with a description.) The second button from the left opens and closes the package content drawer; when the drawer is open, double-click a package to view the files that were installed by that package (Figure 4.11). The third button lets you create a “reinstaller” archive of a package before you uninstall it (in case you change your mind later); however, such archives require you to run scripts in Terminal to reinstall them, so they aren’t the most convenient backups. Finally, the fourth button is the “uninstaller” button that lets you remove an installed package; select the package you want to uninstall and click this button—after authenticating, it’s gone. (The button all the way on the right lets you create a queue of uninstalls so that you can remove packages in batches.)

Warning

You can actually uninstall Apple-provided software packages using DesInstaller. For individual applications such as iTunes, iSync, etc., this is OK, but I don’t recommend uninstalling other Apple-provided items unless you know exactly what you’re doing. Removing things like Essentials.pkg or BaseSystem.pkg will leave your Mac in an unusable state and require you to reinstall Mac OS X!

Figure 4.11: Selecting a package to uninstall with DesInstaller

Taking Advantage of Installation Logs

User Level | usually admin
Affects | computer
Terminal | no

Some software is neither self-contained nor does it provide a convenient receipt to tell a utility such as DesInstaller how to remove all of its pieces. For these types of software, you’ll have to find all the pieces manually and then delete them. If you’re lucky, the software installer will have left an installation log somewhere on your hard drive. If so, you can use this log to locate all of the files that need to be deleted for a complete removal of the software.

For example, the following is part of the installer log from Symantec’s Norton SystemWorks (which was saved inside the Norton Solutions folder in /Applications):

Created the Folder: Senior:Applications:Norton Solutions:
Created the Folder: Senior:Library:Application Support:Norton Solutions Support:
Created the Folder: Senior:Library:CFMSupport:
Created the Folder: Senior:Library:Documentation:Help:LiveUpdate Help:html:
Created the Folder: Senior:Library:Documentation:Help:Norton Help Scripts:
Created the Folder: Senior:Library:Documentation:Help:Norton Utilities Help:
Created the Folder: Senior:Library:Preferences:Norton Utilities Preferences:
Created the Folder: Senior:Library:StartupItems:NortonMissedTasks:
Created the Folder: Senior:Library:StartupItems:NUMCompatibilityCheck:
Created the Folder: Senior:Library:StartupItems:TrackDelete:
Created the Folder: Senior:Library:StartupItems:VolumeAssist:
Created the Folder: Senior:System:Library:Extensions:DeleteTrap.kext:
Created the Folder: Senior:System:Library:Extensions:symfs.kext:
Created the Folder: Senior:System:Library:Extensions:SymOSXKernelUtilities.kext:

Using this log, I could find each installed file and folder and delete it (although because some files and folders were installed in restricted directories, I’d need to use a utility such as XRay to delete them).

Using Third-Party Drive Cleaners

Finally, if none of the previous methods is successful, a number of third-party utilities can comb your hard drive for files and folders related to various applications and software packages and then give you the option to remove them. However, most of these utilities simply search by creator codes, file types, and file extensions (topics I’ll cover in more detail in the next chapter), meaning they aren’t really doing much more than you could do yourself using OS X’s Find utility (also covered in the next chapter). In addition, because they tend to rely more on educated guesses about some files than on receipts and installation logs (which are both fairly reliable), there’s a greater chance a file or document that shouldn’t be deleted will be deleted accidentally. If you’re getting the impression that I’m not really a big fan of these types of utilities, you’re reading this right.


Transferring Mac OS X between Computers or Hard Drives

In my experience with users—personally and via participating in online forums and mailing lists— one of the most common questions that users of Mac OS X seem to have is “How do I copy my Mac OS X installation from one hard drive/computer to another?” People generally fall into one of two categories:

  • Those who have bought a new (larger) hard drive and installed it in their Mac, and now want to move everything over from their old hard drive to the new one

  • Those who have bought a new Mac and want to copy Mac OS X and all their files and software over from their old Mac to the new one

The good news is that Mac OS X is, for the most part, hardware independent. That is, the same OS X that runs on a PowerBook also runs on an iBook and a G5 tower. That means you can usually copy Mac OS X, and all installed software and files, directly from one computer to another, and it should boot up and function properly. (This isn’t entirely true—sometimes the very latest Macs require a slightly different version of Mac OS X to support some new feature or piece of hardware. I’ll cover this scenario shortly.)

The bad news is that unlike Mac OS 9, where you could simply connect a hard drive or another computer, select all your files, and copy them over using drag and drop, Mac OS X requires some special tools. The Finder doesn’t always copy invisible files properly (and there are lots of them in OS X), and because of permissions issues, it’s difficult to make sure that all files are being copied.

This is one of those situations where Terminal can do something you can’t do in the Finder. Terminal provides you with all the tools you need—specifically, commands that copy every single file, preserving permissions and file properties—to successfully copy an entire Mac OS X volume. However, most users don’t want to learn the list of commands that it takes to do such a copy. Once again, a third-party developer has come to the rescue; in this case, Mike Bombich, whose Carbon Copy Cloner utility (http://www.bombich.com/software/ccc.html) puts a friendly face on the process. The following sections discuss how you use Carbon Copy Cloner to transfer your hard drive’s contents to another hard drive or to another computer.

Transferring Mac OS X between Hard Drives

User Level | admin
Affects | computer
Terminal | no

I recently got a new hard drive (a nice 120GB one) and installed it in my G4 tower; the previous hard drive (a 40GB model) was getting a bit cramped. I wanted to transfer the contents of my original drive (Mac OS X, applications, documents, the works) to the new drive and then use the new drive as my startup volume. Using Carbon Copy Cloner, the process was a snap. Here’s how to do it. (I’m assuming you’ve already installed the second hard drive or, in the case of an external drive, connected it to your Mac.)

  1. Make sure your destination volume (the “new” drive) has enough space for the contents of the source volume (the “old” drive). If the destination volume already has an operating system on it, you should probably delete it before copying the source volume onto it. If you have valuable files on the destination volume, you should place them in a folder, named Saved Documents or something similar, until the copy is completed.

  2. Launch Carbon Copy Cloner.

  3. From the Source Disk pop-up menu, select the source volume (the one you want to copy from).

  4. From the Target Disk pop-up menu, select the destination volume (the one you want to copy to) (Figure 4.12).

    Figure 4.12: Using Carbon Copy Cloner to copy a Mac OS X volume

  5. Click the Preferences button to choose the options for the copy:

    • If you want to make sure system-level permissions are correct before copying, check the “Repair permissions before cloning” box.

    • If you want to delete folders on the destination before copying same-named items from the source (e.g., if a previous version of OS X is installed on the destination volume and you want to delete it before copying files from the source volume), check the box next to “Delete directories before overwriting.” (If you’re copying to an empty volume, you don’t need to worry about this option.)

    • Since you want to use the destination volume as an OS X startup volume, enable the “Make bootable” option.

    You can ignore the rest of the preference settings. Click the Save button.

  6. If you don’t want particular items to be copied (e.g., old folders you no longer care about), you can select them in the “Items to be copied” window and then click the Delete button or press the delete key on the keyboard.

  7. When you’re ready to copy, click the padlock button to authenticate; you’ll be asked to provide your admin username and password. Then click the Clone button, after which Carbon Copy Cloner will proceed to copy the entire volume, re-create all necessary links, and “bless” the volume so that it can function as a bootable volume. Carbon Copy Cloner will notify you when the copy is done.

  8. Open System Preferences, click the Startup Disk icon, and select the new volume as your startup disk. The next time you restart, the new drive will be the boot volume. You can then erase or remove the original drive.

Transferring Mac OS X between Computers #1: When Both Computers Are Running the Same Version of OS X

User Level | admin
Affects | computer
Terminal | no

Similar to installing a new hard drive, many users who buy a new Mac want to transfer their existing Mac OS X installation from their old Mac to the new computer so they can pick up right where they left off, using their new hardware. You can use Carbon Copy Cloner in exactly the same manner to do this, but first you have to connect the new computer to the old one. Given that most computers supported by OSX have a FireWire port, the easiest way to do this is to use FireWire Target Disk Mode. You’ll need a FireWire cable to do this, which should be available at any computer or electronics store.

Note

In this section, I’m assuming your old computer has a recent version of OS X installed, and you’re simply moving your OS X installation to your new computer. If your older computer has an older version of Mac OS X installed, or if your new computer requires a newer version of OS X, you’d probably be better off to simply copy over your user files and use the copy of OS X that’s already installed on your new computer. Or you can use the procedure outlined in the next section, “Transferring Mac OS X between Computers 2: When the ‘Target’ Computer Requires a Newer Version of OS X.”

Follow these steps:

  1. With the new computer turned off, connect the FireWire cable to a FireWire port on each computer.

  2. Start up your old computer normally if it’s not already running. Log in to an admin account.

  3. On the new computer, hold down the T key on the keyboard and press the power button to start up. Keep holding the T key down until you see a FireWire symbol on the screen. At this point your new computer’s hard drive will mount as a FireWire hard drive in the Finder on your old computer.

  4. If you don’t need any of the files on the new computer’s hard drive, you can actually erase it using the Disk Utility application before starting the copy.

  5. Launch Carbon Copy Cloner on your old computer, and follow the instructions in the previous section, “Transferring Mac OS X between Hard Drives.” (Select your old computer’s hard drive in the Source Disk box and your new computer’s hard drive in the Target Disk box. If you chose not to erase the new computer’s hard drive because you wanted files that came installed on it, be sure to enable the “Delete directories before overwriting” option in the Preferences dialog box.)

  6. When the clone operation is complete, drag your new Mac’s hard drive to the Trash to unmount it from your old Mac, unplug the FireWire cable, and then press the power button on the new Mac to turn it off.

  7. Press the power button on the new Mac again to boot it up normally (using the installation of OSX you just copied over, including all accounts and settings). It should boot up and behave exactly like your old computer.

  8. Give your old Mac to a school in need :-)

Transferring Mac OS X between Computers #2: When the “Target” Computer Requires a Newer Version of OS X

User Level | admin
Affects | computer
Terminal | no

If you’ve upgraded to a new Mac and either your old computer has an older version of Mac OS X installed than the new Mac or your new computer requires a newer version of OS X, you have two choices. The first is that you can create the exact same user accounts on the new Mac and then transfer your user files over via FireWire Target Disk Mode. Apple even has a helpful Knowledge Base article about this type of a move at http://docs.info.apple.com/article.html?artnum=25575.

The second option is to update your old Mac’s OS X installation to the version required by the new Mac and then use Carbon Copy Cloner to copy it to the new Mac, as described in the previous section (“Transferring Mac OS X between Computers #1: When Both Computers Are Running the Same Version of OS X”). If an updater is available that updates your old Mac’s version of OS X to the one required by the new Mac, run that updater on the old Mac and then follow those instructions.

Unfortunately, sometimes such an updater isn’t available. For example, when the PowerBook G4 12" was released, it required Mac OS X 10.2.7, and the newest version of OS X available for most other Mac models was 10.2.6. In this situation, the following procedure can work around this limitation:

  1. With the old computer turned off, connect the FireWire cable to a FireWire port on each computer.

  2. Start up your new computer normally if it’s not already running. If it’s the first time you’ve used the new computer, you’ll need to set up an account and complete the initial setup process. Don’t worry about the specifics, because you’re going to erase the hard drive eventually anyway. All that matters is that you get to the Finder using an admin-level account.

  3. On the old computer, hold down the T key on the keyboard, and press the power button to start up. Keep holding the T key down until you see a FireWire symbol on the screen. At this point your old computer’s hard drive will mount as a FireWire hard drive in the Finder on your new computer.

  4. Using the OS X Install CD/DVD that came with the new computer, perform an Archive and Install installation of OS X (with the Preserve Users and Network Settings option enabled) on your old Mac by selecting the old computer’s hard drive as the destination for installation. (In other words, place the OS X Install CD/DVD in the new computer, but when you run the installer, choose the old computer’s hard drive as the installation volume.) This installs a version of OS X that’s compatible with the new Mac on the old Mac’s hard drive.

  5. When installation is finished, start up your new Mac from the old Mac’s hard drive by selecting it in the Startup Disk pane of System Preferences. (After this step, your new computer should be the “main” computer, but it should be booting from your old computer’s hard drive.)

  6. Launch Carbon Copy Cloner from the old hard drive, and follow the instructions in the section “Transferring Mac OS X between Hard Drives,” earlier in this chapter. (Select your old computer’s hard drive in the Source Disk box and your new computer’s hard drive in the Target Disk box. If you chose not to erase the new computer’s hard drive because you wanted files that came installed on it, be sure to enable the “Delete directories before overwriting” option in the Preferences dialog.)

  7. When the clone operation is complete, shut down both Macs and unplug the FireWire cable from both.

  8. Press the power button on the new Mac again to boot it up normally (using the installation of OSX you just copied over, including all accounts and settings).

  9. Since you performed an Archive and Install, you may want to read “Restoring Other Files after an Archive and Install,” earlier in this chapter.

  10. Give your old Mac to a school in need :-)


Supporting " Unsupported " Stuff

Team LiB

Supporting “Unsupported” Stuff

I won’t spend too much time on this topic, but I wanted to point out that just because a certain Mac model or third-party peripheral/accessory isn’t “officially” supported by Apple, that doesn’t mean your computer is relegated to the scrap heap. Nor does it mean that you can’t use the latest and greatest accessories with your Mac just because they aren’t supported. Third-party developers have provided some novel solutions that let you use Mac OS X on unsupported hardware and add support for some peripherals that aren’t officially supported with OS X by Apple or peripheral manufacturers. Below are a few examples.

Note

To see if OS X officially supports a particular Mac model, check out http://www.apple.com/macosx/upgrade/requirements.html. For the "official" word on supported peripherals, see http://www.apple.com/macosx/upgrade/devices.html. (Note that these documents refer to Mac OS X 10.3; Apple provides information about compatibility with earlier versions of Mac OS X in the Apple Knowledge Base at http://kbase.info.apple.com/.)

Warning

Remember, “unsupported” means just that—if something goes wrong, neither Apple nor most other software vendors will help you. So use these types of hacks at your own risk.

XPostFacto XPostFacto is a freeware solution that allows you to install Mac OS X on a number of unsupported older Macs (and to install newer versions of Mac OS X on Macs that “officially” only support older versions). For instructions, downloads, and a list of Macs that are compatible with XPostFacto, go to http://eshop.macsales.com/OSXCenter/XPostFacto/.

Sonnet PCI X Installer This is a commercial product from Sonnet Technologies that allows you to install Mac OS X on many computers that have been upgraded with Sonnet processor upgrade cards that would otherwise not be supported. For a list of supported computers and processor cards, visit http://www.sonnettech.com/downloads/osx_upgrade_sw.html.

USB Overdrive X Although you can connect any USB input device to a USB port on your Mac, most devices require some kind of driver to function properly. Unfortunately, some USB peripheral manufacturers haven’t provided drivers for Mac OS X. USB Overdrive X is a shareware driver that works with almost any USB pointing device, allowing you to use mice, trackballs, joysticks, gamepads, etc., that don’t currently have drivers. See http://www.usboverdrive.com/.

Gimp-Print Although Mac OS X includes drivers for many printers, many other printers, including some very popular older printers, aren’t currently supported. However, you can take advantage of Mac OS X’s open-source printing subsystem to provide printer drivers for a wide range of printers. I actually discuss the Gimp-Print drivers in depth in Chapter 12. See http://gimp-print.sourceforge.net/.

Note

If you’re using OS X 10.3 or later, the Gimp-Print drivers are most likely already installed—they’re preinstalled on any Mac that came with OS X 10.3, and they’re a default installation option when you install 10.3 yourself.

VueScan Unfortunately, many scanner manufacturers have been slow to update their drivers for OS X (or, in the case of some older scanners, have decided not to provide OS X drivers at all). What the Gimp-Print drivers do for printers, VueScan does for scanners: provide support for “most high-quality flatbed and film scanners” (that’s a quote from the website). For more information, check out http://www.hamrick.com/vsm.html.

TWAIN SANE TWAIN SANE takes advantage of the open-source SANE universal scanner interface (http://www.sane-project.org/) and "provide[s] access to a large range of scanners connected through SCSI or USB." It isn’t as polished as VueScan, and probably doesn’t offer the same level of customer support, but it’s free. See http://www.ellert.se/twain-sane/.

PCI Extreme or TinkerTool System One of the cool features of OS X 10.2 and later is Quartz Extreme (http://www.apple.com/macosx/features/quartzextreme/)—an advanced graphics technology that’s only supported on particular video cards. In particular, Apple claims that your Mac must have an AGP-based graphics card with at least 16MB of VRAM. This leaves out older Macs that don’t have an AGP slot; laptops with AGP video cards that have only 8MB of VRAM; and the second (or third or fourth) monitor(s) on newer Macs that are being driven from a second or third video card in the PCI slots. For example, my Power Mac G5 has a second video card in one of its PCI slots; monitors connected to that card don’t support Quartz Extreme. These two utilities allow some unsupported cards—specifically, ATI Radeon PCI cards and some ATI Radeon laptop video cards with only 8MB of VRAM—to take advantage of Quartz Extreme. You can get PCI Extreme from http://pages.cthome.net/zacks/. TinkerTool System—the system-level counterpart to TinkerTool, which I’ve already recommended several times in this book—is available from http://www.bresink.com/osx/TinkerToolSys.html. (To see if your video card(s) support Quartz Extreme, or to see if one of these utilities has provided support for an unsupported card, use the System Setup screen of TinkerTool System or try the free utility Quartz Extreme Check, available from http://www.entropy.ch/software/macosx/.)

SWIM 3 Floppy Driver If you have an early beige G3 Mac or a PowerBook G3 Series that came with a floppy disk drive, you’re surely aware by now that OS X doesn’t support the built-in floppy drive. The SWIM 3 driver allows you to use the floppy drive under OS X. Note that this driver only works with pre-installed floppy drives; it doesn’t work on third-party floppy drives. Visit http://www.darwin-development.org/floppy/.

For more information about supporting “unsupported” hardware, or on upgrading your Mac’s existing hardware, visit the Accelerate Your Mac website at http://www.xlr8yourmac.com/. It has become one of the best sources of upgrade information on the Web.


Moving On...

Team LiB

Moving On…

Installing and uninstalling software are some of the most mundane tasks you can perform on your Mac. Yet they’re also some of the tasks that users find the most mystifying. I hope this chapter has helped you become both more familiar with these processes and better equipped to take advantage of them.

At this point I’ve discussed some of the major conceptual topics that surround OS X and covered a bunch of the possible setup and startup options available to you. These topics—permissions, accounts, preferences, startup/login, and software installation—really form the basis of mastering Mac OS X, as many of the topics and tips covered in the rest of this book will involve some combination of the skills and knowledge you’ve gained. Now that you’ve got a handle on these topics, it’s time to start talking about the ways you use OS X every day and how to do those things better, faster, easier, and cooler. Part II, “Files, Finders, Docks, and Apps (Including Classic),” will cover such topics as the Finder, the Dock, applications, and the Classic environment.


Part II: Files, Finders, Docks, and Apps (Including Classic)

Chapter List

Chapter 5: Finagle Files and Foil Finder Frustration (Additional Chapter Supplement Available Online)
Chapter 6: Develop a Dynamite Dock
Chapter 7: Application Aptitude
Chapter 8: Clobbering Classic


Chapter 5: Finagle Files and Foil Finder Frustration

(Or: How to bend the Finder to your will.)

Overview

No matter what you use your Mac for—word processing, e-mail, Web surfing, graphics, multimedia, games, business—you spend a lot of time working with files. Creating files, accessing files, editing files, copying files, moving files, saving files… everything you do on your computer is file- related. It follows that working with files is an area where becoming more proficient can save you time and frustration. However, most Mac users take advantage of only a small percentage of the Finder’s functionality. In this chapter I’ll cover files and the Finder from top to bottom: understanding attributes to setting up settings, working with windows to finding information, customizing contextual menus to optimizing Open/Save dialogs.

In addition to the topics I cover in this chapter, a large part of working with files is accessing them quickly (especially applications). Mac OS X’s Dock is Apple’s solution to this need, but there are many other alternatives as well; I talk about the Dock and Dock alternatives in Chapter 6.

Note

Unfortunately, when I finished this chapter, it had so much chewy Finder goodness that it wouldn’t fit here in the printed version of the book. I didn’t want to simply exclude certain material—which would mean that you, the reader, would miss out on whatever had to be cut—so the publisher agreed to make the extra content available online. You can download a nicely formatted PDF file of “Chapter 5, Part II” from http://www.macosxpowertools.com/ (or from the publisher’s site at http://www.sybex.com/). It contains about 25 more pages on such issues as menu options and add-ons, scripting and automation, file naming and renaming, interface customization, and solutions for some common Finder issues.


File Basics

Before you can master the Finder, you need to master files. Fortunately, doing so isn’t too difficult. However, a few topics deserve your attention, as understanding them will become extremely valuable the deeper you get into using your Mac.

File Types, Creator Types, and File Extensions

For years, one of the biggest “incompatibilities” between the Mac OS and other operating systems had to do with how the respective operating systems determined what kind of file a particular file was. The Classic Mac OS used two different codes—the creator code and file type—attached to the file. The creator code was a four-letter code that identified the application with which a file should be associated. (MSWD was the creator code for Microsoft Word, for example.) The file type indicated what kind of file a particular file was (APPL was an application, WDBN was a Word document, etc.).

Windows and Unix-based systems, on the other hand, use three-letter codes (often called file extensions) appended to the end of filenames to determine each file’s purpose and type. For example, in Windows, any file that ends in .exe is an application, and any file that ends in .doc will open in Microsoft Word.

The reasons for these different approaches are too complex to get into here; I point these differences out because under Mac OS X, Apple has attempted to make many files, especially documents, more cross-platform compatible. Files created in Mac OS X generally have file extensions such as .doc, .txt, and .app. However, because so many Mac users also interact with users of older versions of the Mac OS, Apple had to ensure backward-compatibility as well, so Mac OS X still supports type and creator codes.

What this means for you is that under Mac OS X, some files have creator and type codes but no file extensions; some have no creator/type codes but do have file extensions; some have both; and, believe it or not, some have none of the above (these files are simply bound to the application that created them or first opened them). In addition, each setting can be changed by the user (as I’ll talk about in a bit).

Understanding and Changing File Associations

User Level | normal or admin
Affects | individual user or computer
Terminal | no

Given all these possible settings, how does Mac OS X know how to open a document when you double-click its icon? The answer is that OS X uses a hierarchical model for associating documents with applications. The best depiction I’ve seen of this model is shown in the Type, Creator & Extension panel of the utility XRay (http://www.brockerhoff.net/xray/). In Figure 5.1 I’ve used XRay to get information on a sample text file.

The vertical arrow on the left side indicates how OS X determines what application will be used to open the file if you double-click it. The first thing checked is whether or not the file has been explicitly bound to an application. If no specific application has been set, the creator code is checked. (This is Mac OS 9’s creator code.) If there’s no creator code set, OS X then looks at the file’s three-character file extension. If no file extension exists, OS X then looks for a type code (Mac OS 9’s file type)—if one exists, the OS checks to see which application is generally used to open files with that type code. Finally, if none of this data exists (if all of these fields are blank in XRay), double-clicking the file brings up a dialog asking what application you want to use to open it.

Figure 5.1: A document’s application associations as shown in XRay

Just as XRay provides the best view for understanding the various identifiers a file can have, it’s also my favorite for changing these identifiers. You can click the pop-up menu next to any option to choose a specific application to associate with the document, to select an application from which the creator code should be taken, to select a file extension, or to select an application from which the type code should be taken. Once you’ve made your changes, you need to choose File Ø Save Changes. If you’ve changed the “Bind this item to” setting, you can also click the Bind All Similar Items… button to bind all documents with similar settings to the chosen application.

The XRay window for an application looks slightly different from the one for a file window (Figure 5.2). Although it still has an Extension field (which is empty in the example shown here) and a Type field (which is set to APPL here, indicating that this is an application), the other two fields differ. The top pop-up menu lists all extensions “claimed” by this application, and the second menu lists all file types claimed by it. In other words, if you double-click any document with an extension and/or file type listed in these menus, the document will be opened in this application, unless you have specifically set another application to open files with those characteristics.

Warning

Although it’s generally OK to change file types, creators, extensions, and bindings for documents (especially when you really want to change the application a document is opened using), be careful when changing these variables for other types of files. In Mac OS X, most application and system support files are identified only by their file extensions. For example, if you remove the .app from the end of an application name, it may no longer function as an application.

Changing File Extensions

Although you need to use a utility such as XRay to change a file’s file type and creator code, you can change a file’s extension in the Get Info window for the file (see the next section for details) or in the Finder. To change it in the Finder, simply select the file, press the return key to make the file’s name editable, and then add, edit, or delete the appropriate extension. However, be sure you know what you’re doing here—simply changing a file’s extension doesn’t actually change the file in any way. For example, changing a Word document’s name from document.doc to document.txt won’t convert it to a plain- text document; it will still be a complex Word document that will look pretty ugly when opened in a text editor. Likewise, changing a graphic file’s name from picture.tiff to picture.jpg won’t actually change the file from a TIFF file to a JPEG file. In addition, as I’ll explain later when I talk about Finder Preferences, just because a filename doesn’t show an extension in the Finder doesn’t mean it doesn’t have one. For this reason, I recommend using the Get Info window to change file extensions.

Figure 5.2: An application’s Type, Creator & Extension window in XRay
Tip

If you don’t have the “Always show file extensions” box checked in Finder Preferences, changing a file’s extension in the Finder will bring up an alert window asking you if you’re sure you want to change the extension. The default button is to keep the original extension, which means you can’t just press the return key to get on with your work; you need to actually click the “Use .xxx” button to make the change. In OS X 10.2, pressing the escape key dismisses the dialog while accepting the change. In OS X 10.3 and later, if you have Full Keyboard Access enabled (as discussed in Chapter 2), you can press the tab key to shift focus to the “Use .xxx” button, and then hold the space bar for a second to “click” it.

One more point about file extensions: If you’ve chosen to show file extensions via Finder Preferences (I’ll talk more about that in the next section), extensions will be visible for all files that have them. However, if you’ve chosen not to show file extensions in the Finder, don’t expect all extensions to disappear. Each file has its own hide/show extension setting, visible in its Get Info window. If this setting hasn’t been used, the file will obey the Finder Preferences setting; however, if it has been set (by you, by a developer, by another user), the file’s own setting will override the Finder’s setting. I point this out because it’s very easy—too easy, in my opinion—to add a file extension to a file that’s already got a hidden one.

The Get Info Window

I talked about the Finder’s Get Info window several times in Chapter 1 when I discussed changing file ownership and permissions. However, you can view and edit a number of other bits of information in the Get Info window’s various panels, which can be viewed by clicking the disclosure triangle next to each panel’s name. Here are a few tidbits about these panels.

Tip

The Get Info window in Mac OS X 10.1 and earlier was actually a dynamic palette called the Show Info Inspector. You could have only a single Show Info inspector open; this inspector floated above all Finder windows and changed to reflect the info for whatever Finder item you selected. As a result of user feedback, Apple changed the Get Info window to its current OS 9–like implementation—each item gets its own Get Info window, and you can open as many windows as you like. If you prefer the inspector version, hold the option key down as you access the Finder’s File menu: File Ø Get Info changes to File Ø Show Inspector.

The General Panel

The General panel is the default view of Get Info windows. For all types of files and folders, it shows you the item’s icon and name; the kind of file (taken from the file’s type code, or, if one doesn’t exist, from the file extension); the size of the file; the location of the file; the creation date and time; the date and time the item was last modified; and whether or not the item is locked. You can also toggle the Locked status on and off; on (locked) means the item can’t be modified or deleted.

In addition, the General panel provides other information depending on the file type. Get Info windows for documents include a Stationery Pad option. When checked, the document becomes a sort of template—if you open the file, a copy is made and opened instead, leaving the original untouched. Get Info windows for applications include information on the application’s version number and (usually) developer. Finally, when you Get Info on a volume, the General panel provides information on the volume format, capacity, and the amount of space used and available.

Tip

To get information for a group of files, select them all in the Finder and then choose File Ø Get Info. The General panel of the resulting Info window will show the total number of applications, documents, and folders, and the total size of all the items in aggregate.

The Name & Extension Panel

The Name & Extension panel simply provides a way for you to edit an item’s name and extension. Although you can change the item’s extension in the Finder, it’s preferable to do it here or using a third-party file utility, because (as I mentioned earlier) sometimes the Finder doesn’t show the true extension.

You can also choose to show or hide a file’s extension in this panel; this setting takes precedence over the setting in Finder Preferences to show or hide extensions.

The “Open with” Panel

The “Open with” panel is present only for documents; it lets you choose an application with which to open the document. As I mentioned earlier, if you choose an application in this panel, the setting overrules any other application association, such as creator type, file type, or file extension. If you click the Change All… button, the setting will be applied to all documents with the same characteristics as the current file.

The Content Index Panel

This panel is present only for folders and volumes. I’ll discuss it in detail later in the chapter when I talk about finding files by content (in “Finding Files, Folders, and Information”), but it basically allows you to index the content of files within volumes and folders and to see when the most recent index occurred.

The Preview Panel

The Preview panel is virtually identical to the Preview column in Finder windows viewed as columns (discussed later in this chapter). It exists for all Get Info windows, but its contents differ depending on the type of file. For any kind of item but a document, the Preview panel is simply a larger version of the item’s icon. However, for document files, the Preview icon often provides you with a helpful preview of the file’s contents (Figure 5.3). Note that not all documents take advantage of the Preview function; Word documents, for example, simply show a document icon.

Click To expand
Figure 5.3: The Preview panel for (left to right) a text file, an MP3 file, and a QuickTime movie
Tip

When previewing a music or video file, you can click the volume icon to change the volume. If you press shift as you change the volume, you can force the volume to play much louder. (For some reason, this trick seems to work only in the Preview panel of the Get Info window, in the Preview column of Finder windows, and in QuickTime Player; i.e., it doesn’t work in applications.)

The Memory Panel

The Memory panel appears only for Classic applications—applications written specifically for Mac OS 9. As I’ll explain in Chapter 8, Classic applications will run in Mac OS X’s Classic environment, but they still use OS 9’s memory management system. The memory panel shows the suggested, minimum, and preferred memory allocations for each Classic app (and allows you to edit the minimum and preferred amounts as needed).

The Languages Panel

The Languages panel appears only for applications; it allows you to disable supported languages in an application and re-enable them, if necessary, later. If you’ve done any digging around inside application packages, you know that language support is usually contained inside the /Contents/Resources direc- tory of a package. If you select a language in this panel and then click the Remove… button, a new directory, /Contents/Resources Disabled, is created, and the resources for the selected language are moved there. This doesn’t save any hard drive space, nor does it affect how fast the application loads or runs. However, if you change your OS language to Spanish, for example, but have removed Spanish from an application’s Languages panel, the application will not play along with the rest of the Spanish-speaking system—it will use a language for which it does include support (for most applications on most Macs, that will be English). The only reason I can see for using this feature is if an application’s language files are causing problems. (If you need to re-enable a language that you’ve removed, click the Add… button and navigate to the Resources Disabled folder inside the application package to find it.)

The Plug-ins Panel

The Plug-ins panel works just like the Languages panel but is shown only for applications that support the standard Mac OS X plug-in architecture (iMovie is a good example). You can remove plug- ins, and later add them back in if desired. If one of your plug-ins is misbehaving, this solution is much easier than having to dig into the package contents of the application. The Add… button is also a convenient way to add third-party plug-ins to applications such as iMovie.

The Ownership & Permissions Panel

This panel, which appears for all types of items, allows you to view and modify file ownership and permission settings. I discussed it in detail in Chapter 1.

The Comments Panel

Finally, all types of items have a Comments panel. You can use it to type in any sort of comment about the item that you like. I never use this panel, but I know people who use it regularly for things like keeping track of each application’s serial or registration number or making notes about where a particular file came from.

Note

Even though Mac OS 9 also has a Comments field in its Get Info windows, those comments don’t appear in OS X’s Comments field, and vice versa. I talk more about this problem in the Online Appendix.

Other File Attributes

In addition to the standard attributes I just discussed, files in OS X also have other attributes that aren’t available from the Get Info window. A few, such as the immutable flag and the SetUID, SetGID, and Sticky bits attributes, are fairly esoteric and beyond the purview of this book. However, one, labels, is old hat to OS 9 users but new to OS X 10.3 and later; another, invisibility, is used frequently by Mac OS X and is important enough that Ill spend some time talking about it.

Labels

One of the extremely popular file attributes present in Mac OS 9 and earlier that was missing in early versions of Mac OS X was the Finder label—you could apply one of seven color “highlights” to any item in the Finder. Thankfully, Apple brought this feature back with OS X 10.3; users can now label files and folders using various colors to categorize and identify them. However, whereas in OS 9 labels are applied to file icons—a shame if the developer spent a lot of time trying to make the perfect icon—in OS X the label is instead applied to the file’s name, leaving the icon untouched. (Given how much nicer icons can look in OS X, I personally applaud this change, although I know more than a few people who disagree with me.)

After selecting an item (file, folder, application, etc.) in the Finder, you can apply a label to it in one of two ways. The first is to click the Finder’s File menu; at the bottom of the menu is a section called Color Label with seven colored circles (corresponding to the seven available label colors) and a gray x (which simply means “no label” or “remove label”). Choose the appropriate color to apply it, or choose the x item to remove an existing label.

Tip

If you choose to view the Label column in the Finder’s list view, as explained later in this chapter, you can sort Finder windows by label so that items are grouped by label. You can obtain a similar result in icon view by choosing View Ø Arrange Ø By Label.

The second way to apply a label to a Finder item applies only to items selected within a Finder window: Click the window’s Action menu button (the toolbar item that looks like a sprocket) and then choose the appropriate label from the resulting menu. (I’ll talk more about the Action menu later in this chapter.)

Although many users don’t think of labels this way, the color isn’t actually the label. Rather, the color is simply a way of visually representing the text that is the label. If you open the Finder’s preferences window (Finder Ø Preferences) and then switch to the Labels panel, you’ll see that each label color has a name (the name of the color, by default)—this text is the actual label. Although you can’t change the colors of labels, you can change the label text to make it useful to you. For example, as I was writing this edition of Mac OS X Power Tools, I had a folder for each chapter that contained the first edition text as well as notes, software, images, documentation, etc., that I needed to go through to revise that chapter. I changed the label names to reflect various status levels, and then updated the label for each chapter folder accordingly: red=Untouched, orange=First Revision Done, yellow= Second Revision Done, and green=Done! With a quick glance at the enclosing folder, I could see the status of every chapter.

Tip

If you’re still using Mac OS X 10.2 or earlier, you can get your OS 9 labels back using the shareware Labels X (http://www.unsanity.com/haxies/labels/).

If you apply a label to a file in OS X, it transfers over if you boot into OS 9, and vice versa—so if you did a lot of file labeling in OS 9, and those files are still on your computer, you’ll be pleased to find out that all of your previous labels show up in OS X 10.3 or later!

Invisibility

Invisibility is actually a pretty important file attribute in Mac OS X, as it is used to hide the many files— used by the system but typically not by the user—that would otherwise add visible clutter to folders and volumes. Invisibility is also used to hide files that shouldn’t be deleted or moved by the user.

There are three ways a file can become invisible in OS X. The first is the invisible bit file attribute. A file with the invisible bit enabled won’t be visible in the Finder. Although you can’t enable/disable the invisible bit from the Finder’s Get Info window, it’s fairly easy to do using a third-party utility such as XRay (mentioned earlier), FileXaminer (http://www.gideonsoftworks.com/filexaminer.html), or File Buddy (http://www.skytag.com/). All of these utilities have a simple checkbox that lets you toggle the invisible bit. (Note that once you toggle the bit, you generally have to relaunch the Finder for the actual visibility to change. You can do this by selecting Force Quit… from the Apple Menu and relaunching the Finder via the Force Quit Applications window, or by holding down the option key as you control/right-click the Finder’s icon in the Dock and then choosing the Relaunch command in the resulting Dock menu.)

Note

If you’ve installed the Mac OS X Developer Tools, you can also change a file’s invisible bit using the SetFile command in Terminal, but it’s not as quick or easy as using a third-party file utility. However, Terminal does have the advantage of ignoring the invisible bit, so if you list a directory’s contents in Terminal using the ls-a command, all files will be visible, even those that are supposed to be invisible.

Although it’s easy to make a visible file invisible, making an invisible file visible is a bit tougher— because you have to access the file, and it’s, well, invisible. A number of utilities are available that allow you to find or view invisible files, but for me the easiest way to find an invisible file is to use the Finder’s Find tool. I’ll talk about this tool in more detail later in the chapter (in “Finding Files, Folders, and Information”), but for now, just choose File Ø Find… in the Finder. In the Find window, select the location to search using the “Search in” pop-up, choose “Visibility” from the left-most pop-up menu (the criterion pop-up, although it isn’t labeled), and then choose “invisible items” from the pop-up menu to the right. If you know the name of the file, you also search by name by adding a second criterion: Click the plus (+) button on the right, choose Name from the new criterion popup menu, choose "contains" or "is" from the second pop-up menu, and then type the name of the file into the text field. Click the Search button, and you’ll get a window with a list of all the invisible files that match your criteria. Find the one you want, and drag its icon from the results window onto one of the file utilities mentioned above. You can then disable the invisible bit. Whew!

The second way a file becomes invisible in Mac OS X is if it begins with a period (.). If it does, the Finder hides the file. However, although you can change an item’s file extension in the Finder, you can’t add a period to the beginning of its name to make it invisible—the Finder simply won’t let you do it. However, you can drag it to your favorite file utility and change the name there. If you want to remove the period from a file’s name to make the file visible, you need to use a technique such as the one described above to access the file; then drag the file to your favorite file utility and change the name from within the utility.

The final way a file becomes invisible is via a text file called .hidden, located at the root level of the startup volume (and, of course, invisible because of the period at the beginning of its name). Any file or folder included in this file will be hidden from view in the Finder. Although it’s technically possible to edit this file to include your own files and/or folders (or to remove files or folders from the file to make them visible), I don’t recommend it. Since the .hidden file is created by the OS, you might change something you shouldn’t; in addition, the next time you install a major system update, there’s a good chance the file will be replaced by a newer version. If you really want to view the file just to see what its contents look like, use the Finder’s Find tool again, this time searching for invisible items whose name is ".hidden"; when the search is complete, drag the .hidden file from the results window onto the TextEdit application.

Tip

A number of third-party utilities, such as TinkerTool (mentioned earlier in the book) and InVisibles (http://www.mac4ever.de/invisibles/), let you enable a special option to view all hidden/invisible files in the Finder.


Finder Preferences and View Options

In Chapter 2, I covered the System Preferences application, which provides access to most Mac OS X settings. However, the Finder has a few settings of its own that aren’t located in System Preferences. Here are the details on these options.

Finder Preferences

User Level | any
Affects | individual user
Terminal | no

The job of the Finder is to provide you with an interface to manage files, folders, and applications. If you’re wondering why the preferences for the Finder aren’t located in System Preferences like other Mac OS X settings, remember that the Finder is an application, just like your e-mail client, your word processor, and your Web browser. (The main difference is that Mac OS X knows to always keep the Finder running, so if it crashes or if you force quit it on purpose, it will automatically relaunch.) As such, the Finder’s preferences are located exactly where you’d expect to find them in any other application: in the Finder’s application menu.

When the Finder is active, choose Finder Ø Preferences… You’ll be presented with the Finder Preferences dialog, which, as of OS X 10.3, is divided into four panels: General, Labels, Sidebar, and Advanced. Although some of the settings are fairly straightforward, a few deserve more detailed descriptions. (I discuss each panel separately.) Some of the features mentioned here won’t be discussed in detail until a bit later in this chapter; however, since the Finder’s preferences are so central to working with files and folders, I want to mention them up front.

The General Panel of Finder Preferences

Prior to OS X 10.3, this panel (Figure 5.4) basically was the Finder Preferences dialog; it looked very much the same except that it included a couple of settings that are now located in the Advanced panel. Here’s what each group of settings means in the OS X 10.3 version.

Figure 5.4: The General panel of the Finder Preferences dialog

Show these items on the Desktop In Mac OS 9, every connected hard drive, every mounted server, and every type of mounted removable media (CD, floppy disk, DVD, MO disk, etc.) showed up on the Desktop. To access a volume, you double-clicked it. This was great for easy access, but not so great for Desktop clutter. For example, on my old computer, I had three hard drives, each divided into multiple partitions. After inserting a CD, mounting a couple remote servers, and mounting a disk image or two, I often had 10–15 volumes mounted on my Desktop! In Mac OS X, you have the option to show or not show particular types of volumes on the Desktop, in any combination. I personally choose to always show Removable media and connected servers, but I hide hard disks to keep my Desktop a bit neater. (You can always access these items via the Computer view in a Finder window, or by choosing to have them appear in Finder window side-bars, discussed later in this chapter.)

New Finder windows open Because of Mac OS X’s multi-level (System, Local, User) file organization, many users can get by without ever leaving their home folder (~/). In fact, for many beginning users, trying to find their home folder from the root level of the hard drive would be a challenge. The "New Finder windows open" pop-up menu allows you to choose what directory is displayed when a new Finder window is opened. When set to Home, the window opens automatically to the current user’s home directory; when set to Computer, the window opens in the Computer view, which is simply a list of all mounted volumes and the Network icon. You also have the option to open new windows at the root level of any local hard drive, at the root level of your iDisk, at the root level of your Documents folder, or, via the Other… item, at the root level of any other folder on your Mac.

Tip

If you unchecked any items under “Show these items on the Desktop,” and you don’t choose to have these items displayed in Finder sidebars as discussed later in this chapter, I recommend setting “New Finder windows open” to Computer so that you’ll be able to easily access mounted volumes, disks, servers, etc., by opening a new Finder window. (You can still go directly to your home directory using the Home item in the sidebar or the toolbar, or by choosing Go Ø Home in the Finder.)

Always open folders in a new window This setting is a bit confusing, since it only applies to certain window view options. As I’ll talk about later in the chapter (in “Working with Windows”), Mac OS X’s Finder windows have three options for viewing files: icon view, list view, and column view. In icon view and list view, if you want to view the contents of a folder, you double-click it (or select it and choose File Ø Open). By default, Mac OS X will open the folder within the existing window (i.e., the current window will immediately change from displaying its current contents to displaying the contents of the folder you just “opened”); in order to open the folder in a new window of its own, you have to hold down the command key as you open it. By checking this box, you change the default behavior so that opening a folder opens it in a new window.

Tip

If the “Always open folders in a new window” box is checked, there’s no way to open a folder using an existing window. However, if you hold down the option key as you open a folder, the existing window will close as the new one opens. It’s not exactly the same, but at least you’re left with only a single window.

Open new windows in column view By default, new Finder windows will be presented using the most recently used view option (icon, list, column). However, if this box is checked, new Finder windows will always be presented in column view. Note that this setting applies only to new Finder windows created by choosing File Ø New Finder Window (or by pressing command+N) in the Finder; a window opened by double-clicking a volume or folder in an existing window will inherit the view of the current window, or (as explained in the sidebar “Getting Window Settings to Stick”) will open in the view last used for that volume or folder.

Spring-loaded folders and windows I’ll talk about spring-loaded folders and windows a bit later in this chapter (in “File and Folder Finesse”), but in a nutshell, if you drag an item over a volume or folder icon in the Finder, and hold it there, eventually the volume or folder will open, revealing its contents, so that you can place the dragged file or folder inside a subfolder of that volume/folder. This setting lets you choose the length of the delay before the volume/folder opens.

The Labels Panel of Finder Preferences

I discussed labels earlier in this chapter; this panel of Finder preferences is where you can customize the label text corresponding to each color.

The Sidebar Panel of Finder Preferences

I’ll talk about Finder window sidebars later in this chapter (in “Working with Windows”); here is where you decide which “stock” items always appear in your sidebars.

The Advanced Panel of Finder Preferences

The Advanced panel contains a couple settings that I guess would qualify as “advanced,” as well as one that just doesn’t seem to fit anywhere else.

Show all file extensions Earlier in this chapter I talked about file extensions (the .xxx extensions at the end of some files’ names that indicate what type of file each is), and how you can choose to show or hide such extensions—when they exist—on an individual basis using the Get Info window. However, what about files that haven’t explicitly been set to show or hide their extensions? By default, Mac OS X hides the file extensions for these files. If you enable this option in Finder Preferences, files extensions will be shown for all files except those for which you have explicitly set the option to hide them. (That sounded a bit convoluted, but that’s because it’s a bit of a convoluted setting.) I personally prefer to show file extensions, because it prevents me from adding an extra extension (for example, from accidentally naming sample.rtf as sample.rtf.rtf).

However, many users dislike seeing file extensions at all. It’s more of a personal preference than anything else. Just remember that if you don’t have this preference selected, a filename may actually contain an extension that’s hidden.

Show warning before emptying the Trash If this item is checked, when you choose Finder Ø Empty Trash (or press shift+command+delete), you’ll be presented with a dialog asking if you’re sure you want to empty the Trash. Unchecking this option means that the Trash will always be emptied immediately, without the dialog appearing.

Tip

If you have “Show warning before emptying the Trash” checked, but you want to bypass the warning for a single emptying, you have three options: (1) You can hold down the option key as you choose Finder Ø Empty Trash; (2) you can press shift+option+command-delete; or (3) you can control-click (or right-click if you have a multi-button mouse) the Trash icon in the Dock, and then select Empty Trash. Using these methods, you’ll never receive the confirmation dialog, no matter what your setting is in Finder Preferences.

Languages for searching files contents As I’ll discuss later in this chapter (in “Finding Files, Folders, and Information”), Mac OS X allows you to not only search for particular files, but also to search for words or phrases within files. It does this by indexing the text inside each file. By clicking the Select… button, you can choose what languages Mac OS X uses when indexing file contents. (Enabling a language means that OS X will index common words from that language and allow you to search for those words.) Unselecting languages that you (and your documents) don’t use will speed up the indexing process and reduce the size of your file content indexes.

View Options

User Level | any
Affects | individual user
Terminal | no

You’ll find the other major Finder-related settings in the View Options dialog, accessible by choosing View Ø Show View Options. These settings let you control how icons are arranged, what information is provided with filenames, and other settings related to file display in the Finder. However, this “dialog” isn’t really a dialog—it’s actually a palette, meaning it floats above other Finder windows and objects. It’s also contextual, meaning it changes depending on which window is active in the Finder and how that directory is being viewed. Because the View Options window changes based on the current view, I’ll talk about the specific options it provides when I talk about the Desktop (“The Desktop and the Desktop Folder”) and window views (“Working with Windows”).

Now that I’ve talked about Finder options, it’s almost time to talk about working with files and folders. However, since you access these items via the Desktop and Finder windows, I’ll first give you some background information on, and tips for working with, the Desktop and windows.


The Desktop and the Desktop Folder

The Desktop is one of the busiest areas of any Mac. Since it’s the easiest place to get to quickly, and you can (almost) always see it, many people use it as a place to put frequently used items, work in progress, and even permanent files and folders. If you’ve chosen to show mounted volumes on the Desktop, you can also use it to access those volumes. Here are a few tips to help you get to the Desk- top more easily and to make it work better for you.

Where/What Is the Desktop Really?

If you’re a veteran Mac user, you probably know that in Mac OS 9 and earlier, the Desktop was actually an invisible folder called Desktop Folder at the root level of the hard drive. If you had multiple hard drives, each of them had their own Desktop Folder. These Desktop Folders were shared by all users.

In Mac OS X, the Desktop is handled a bit differently. It’s still a folder; however, because each user has their own Desktop, each user has their own Desktop folder, located at ~/Desktop. (Remember, this is equivalent to /Users/username/Desktop.) If you navigate to this folder in a Finder window, you’ll find it contains everything that’s visible on the Desktop of your computer (except mounted volumes, of course).

Note

If you actually see a folder called Desktop Folder at the root level of a volume when running Mac OS X, it’s because that volume was used under Mac OS 9 or earlier. (Perhaps you booted your computer into OS 9 or used your computer in Target Disk Mode on a computer running OS 9.)
Tip

If you boot into Mac OS 9 and need to access something on your Mac OS X Desktop, remember that it won’t appear on your OS 9 Desktop—you need to navigate to /Users/username/Desktop to find it. Likewise, if you put something on your Desktop under OS 9 and later boot into OS X, it’s not easy to access that item. I’ll talk more about this situation in the Online Appendix.

View Options for the Desktop

User Level | any
Affects | individual user
Terminal | no

If you make the Desktop active (by clicking anywhere on it) and then choose View Ø Show View Options (or press command+J), the View Options window will appear—it will say Desktop in the title bar—and will present you with options specific to the Desktop (Figure 5.5). You can choose the size of Desktop icons, ranging from tiny (16 ´ 16 pixels) to huge (128 ´ 128 pixels). You can also choose the text size of Finder labels (filenames, item info, etc.), as well as choose whether you want those labels to appear below or to the right of Finder icons.

The “Snap to grid” setting, if checked, keeps Finder icons arranged in a neat grid; you can drop an icon anywhere, and it will instantly snap to the closest grid space. If you don’t select the “Snap to grid” option, you can still make Desktop icons snap to the invisible grid on a case-by-case basis: Drag an icon (or icons) to the approximate area you want them to reside, but before you release the mouse button, hold the command key down. When you release the mouse button, the icon(s) you’ve moved will automatically position themselves as if “Snap to grid” were enabled. (Conversely, if you enable “Snap to grid,” the command key will temporarily disable the grid for the current drag.)

Figure 5.5: View Options for the Desktop
Tip

If you want really big Desktop icons, launch Terminal and type defaults write com.apple.finder DesktopViewOptions -dict IconSize -integer 'xxx' <RETURN>, where xxx is some number bigger than 128 (which is the largest size available in Desktop View Options)—I suggest 256 for a start. Then relaunch the Finder—the easiest way is to option+control-click (or option+right-click, if you have a multi-button mouse) the Finder icon in the Dock and then choose Relaunch from the resulting menu. Your Desktop icons will immediately use the larger size. To change back to a "normal" size, simply use the icon size slider in Desktop View Options.

“Show item info” provides additional info about an item directly below the item’s name; the actual info provided differs depending on the item. For volumes, you’ll see the total space used on the volume and the free space remaining; folders will show the number of items (files or folders) at the root level of each folder; info on graphics files will include the dimensions of the picture (in pixels); and movie and sound files will be listed with the length of the movie or sound.

If you select “Show icon preview,” any graphics file (GIF, JPG, TIFF, etc.) that contains an icon preview will use that preview as its icon instead of its default file type icon.

Finally, “Keep arranged by” allows you to keep files and folders arranged by name, kind, date modified, date created, size, or label (always in ascending order), so items with a filename or kind that starts with A, older items, smaller items, and items with no label (then red, then orange, etc.), respectively, will be listed first. Note that if you’ve checked “Keep arranged by” and you’ve also chosen to show mounted volumes on the Desktop (in Finder Preferences), the boot volume will always be listed first, followed by other mounted volumes, and then files and folders.

Accessing the Desktop (Especially When It’s Hidden)

User Level | any
Affects | individual user
Terminal | no

I’m sure you’ve been faced with this situation before—you need to open a file you’ve placed on the Desktop, but you can’t see it because of all the windows that are open. Although the Desktop is extremely handy in terms of providing quick access to files, one of the biggest obstacles most people experience in using the Desktop for this purpose is that it’s often obscured by Finder and/or application windows. Fortunately, under OS X there are many ways to get around this obstacle. I’ve included a few here. (These methods are useful even when the Desktop isn’t obscured; I use a couple of them as my regular method of accessing Desktop files and folders.)

Hiding Everything but the Finder

If you’re trying to get to the Desktop, but you have a number of application windows open, you can just hide all applications except for the Finder. There are actually two ways to do this: The first is to hold down the command and option keys and click the Finder icon in the Dock; this works regardless of whether or not the Finder is the frontmost (active) application. If an application other than the Finder is frontmost, you have a second option: Hold down command+option and click anywhere on the Desktop. In either case, the Finder will be brought to the front, if necessary, and all other applications will be hidden. (To make all applications visible again, choose Application Name Ø Show All.)

Hiding Everything, Including Finder Windows, Using Exposé

The only drawback to the methods I just described is that they don’t hide Finder windows—if you have a number of Finder windows open, they may still obscure the Desktop. You can minimize each Finder window to the Dock by clicking the yellow minimize button in the top-left corner, or you can minimize all Finder windows at once by holding down the option key as you click the minimize button in any Finder window. However, it’s a bit of a pain to have to manually minimize windows just to see items on your Desktop. It would be nice if you could just hide everything so that the Desktop is unobstructed. If you’re using Mac OS X 10.3 or later, you’ve got the simplest, and most elegant, solution ever right at your fingertips: Exposé. Simply press whatever function key (or move the cursor to whatever screen corner, or click whatever mouse button) you’ve assigned to the Desktop in Exposé preferences, and all windows in all applications (including the Finder) will slide off of the edges of the screen, giving you complete access to anything on the Desktop. In fact, you can even drag items while using Exposé, as I’ll explain in Chapter 7. (I’ll talk about Exposé in much more detail in that chapter.)

Tip

If you’re not yet using Mac OS X 10.3, you can instead use the donationware Show Desktop (http://www.everydaysoftware.net/), which lets you hide (and restore) all windows with a click in the Dock or the menu bar.

Accessing Desktop Contents Directly

If your goal isn’t necessarily to view the Desktop, but to simply access files or folders that reside there, you can do so in a number of ways without having to hide or close Finder and application windows. Here are a few quick solutions.

Accessing Desktop Contents from a Finder Window

In terms of accessing files and folders that reside on the Desktop, the first thing to remember is that the Desktop is just a folder, just like any other folder in Mac OS X. Because of this, you can easily access its contents in any Finder window. Simply navigate to your home folder, and then open the folder named Desktop. Any file or folder on your Desktop resides in this folder, and you can perform any actions on them here that you could by accessing them on the Desktop itself. You can take advantage of the sidebar or the toolbar, as discussed later in this chapter, to provide yourself with quick access to the Desktop folder.

Accessing Desktop Contents from the Dock

As I’ll discuss in more depth in Chapter 6, you can place any folder in the Dock and access its contents easily. If you put this information together with the previous tip, you’ll realize that you can actually put your Desktop folder in the Dock. To do this, simply navigate to your home directory in the Finder, and then drag the folder Desktop to the Dock (you’ll have to drag it to the right side of the Dock’s divider line). You’ll then see an icon in the Dock that looks like the Desktop.

If you click and hold the Desktop icon in the Dock (or control/right-click that icon), a menu will pop up listing the contents of the Desktop folder (which are simply any items sitting on your Desktop) (Figure 5.6). Selecting an item will open it directly. If any of the items are folders, you’ll notice an arrow next to their names, indicating a hierarchical menu. Thus from this menu you can open any file on the Desktop, as well as any file within any folder on the Desktop.

Figure 5.6: Accessing the Desktop folder in the Dock
Accessing Desktop Contents Using MaxMenus
User Level | normal or admin
Affects | individual user or computer
Terminal | no

Along the same lines as the previous hint, numerous third-party add-ons allow you to easily access the contents of the Desktop. My personal favorite is MaxMenus (http://www.proteron.com/), which lets you create multiple menus, each with different contents. After you’ve installed MaxMenus, you can easily create a menu for the Desktop.

  1. Open System Preferences, and then select the MaxMenus preference pane; click the Menus tab.

  2. Choose where you’d like the menu to appear from the Choose Menu pop-up. I personally use the Lower Right setting, as it’s closer to the Dock (where the mouse cursor tends to be a lot anyway), but another of my favorites is “Menubar empty area,” which lets me click any empty area of the menu bar to access my custom menu.

  3. In the list of available items on the right, click Desktop and drag it to the menu items list on the left (Figure 5.7).

  4. You can choose extra options for the menu by clicking the Edit… button next to the Choose Menu pop-up. For example, you can change the color of the menu symbol that will appear in the specified corner of the screen, and you can choose to access the menu by a simple mouse click, via a combination of keys and the mouse, or via a keyboard combination.

  5. When you’re finished, close System Preferences. Your new menu will be accessible in the corner (or menu bar area) you’ve chosen.

Now that I’ve covered the Desktop, I’ll talk about Finder windows.

Figure 5.7: Creating a Desktop menu in MaxMenus


Working with Windows (Finder Windows, Not Microsoft Windows)

People use the Finder every day without thinking much about it, and this is especially the case when it comes to Finder windows. Apart from moving things around on the Desktop, any interaction you have with the Finder is via Finder windows. Yet these windows are one of the areas where most users are taking the least advantage of the built-in power and flexibility of Mac OS X. In the following sections, I’ll show you how to do some new things and how to do some of the things you already do even better.

Note

In the discussion that follows, I talk specifically about the Finder windows in Mac OS X 10.3 and later. These differ from Finder windows in Mac OS X 10.2 and earlier both in terms of the way they look (“brushed metal” vs. Aqua) and with respect to Finder sidebars (which don’t exist in versions of OS X prior to 10.3). However, aside from these two major differences, Finder windows otherwise function very similarly across versions of Mac OS X.

The Toolbar

Mac OS X introduced a new feature to Finder windows, the toolbar. Although it may not always be visible, every Finder window has a toolbar, and these toolbars provide an impressive amount of functionality. Open a new window in the Finder, and you can follow along as I show you some of the ways you can use the toolbar to your advantage.

Tip

You can show or hide Finder window toolbars in several ways. You can click the toolbar widget in the upper-right corner of any window to toggle it on/off. You can select View Ø Hide Toolbar to hide the toolbar (or View Ø Show Toolbar to show it). Finally, you can press command+option+T (command+B in OS X 10.2 and earlier) to toggle the toolbar on and off. Note that in OS X 10.3 and later, disabling the toolbar for a Finder window also disables the “brushed metal” window appearance and, more important, the sidebar.

Figure 5.8 shows the default toolbar for a window in OS X 10.3. (If you’ve already customized your toolbars, yours may look a bit different.) The back and forward buttons allow you to quickly return to the previous folder you were browsing or (if you already used the back button) to return to the “next” folder, respectively. (If you’ve ever used the back and forward buttons in a Web browser, these work the same way.) The View buttons allow you to quickly switch between window views: icon, list, or column. (I’ll talk about the different window views shortly.) The Action menu, which I’ll talk about below, is similar to the Finder’s contextual menus but is available at any time from the toolbar. Finally, the Search field allows you to perform basic file/folder searches; I’ll talk more about using the Search field later in this chapter.

However, just because this is the default toolbar for Finder windows doesn’t mean you’re limited to this configuration. The next section shows you how to configure it to your liking.

Click To expand
Figure 5.8: The default Finder window toolbar in OS X 10.3 (top) and the same window with the toolbar hidden (bottom)

Customizing Finder Toolbars

You can customize Finder toolbars in two ways: by using Mac OS X’s built-in configuration tool and by manually adding items to it.

Customizing the Toolbar Using Mac OS X’s Customize Toolbar Feature
User Level | any
Affects | individual user
Terminal | no

Although Apple has chosen a default toolbar configuration for you, Mac OS X includes a useful configuration tool that allows you customize Finder toolbars any way you like. To access this tool, open a new Finder window and choose View Ø Customize Toolbar… (You can also control/right- click anywhere in the toolbar and then choose Customize Toolbar… from the resulting contextual menu, or command+option-click the toolbar widget in the upper-right corner of the Finder window. In OS X 10.2 and earlier, you can instead shift-click the toolbar widget.) You’ll be presented with the Customize Toolbar dialog (Figure 5.9). The dialog doesn’t cover the toolbar itself, so you can still see your toolbar’s current configuration.

Note

The toolbar must be visible in order to customize it.

Figure 5.9: The Customize Toolbar dialog

The top section of the Customize Toolbar dialog contains all of the standard toolbar items you can place in the toolbar. To include an item in the toolbar, drag it from the items section and drop it on the toolbar. Existing items will move out of the way to allow you to place it exactly where you want it. You can also change the arrangement of items already in the toolbar by dragging them left or right (again, the other items will move out of the way). In order to remove an item, drag it from the toolbar and drop it anywhere outside the toolbar; it will disappear in a “puff” of smoke. (You can also control/right-click an item in the toolbar; the resulting contextual menu will include a Remove Item command.) Note that if you’ve added more items to the toolbar than will fit in the current width of the window, once you close the Customize Toolbar dialog you’ll see a double arrow symbol on the right side of the toolbar. Clicking this symbol will give you a menu of all toolbar items that won’t fit in the current window. (You can also resize the window so that it’s big enough to view all toolbar items.)

Note

Toolbar configurations you’ve customized here apply to all Finder windows, not just the current window. In addition, they apply only to windows in the Finder, not in applications. However, many applications that use Mac OS X– style toolbars also provide customization options. You can usually access these options by holding down command+shift as you click the toolbar widget, or by using the Customize Toolbar item in the View menu. Some applications also allow you to control-click or right-click in the toolbar itself to bring up a toolbar customization menu.

Although most of the available toolbar items are fairly self-explanatory, a few deserve brief explanations.

Action The Action item is actually part of the default toolbar set in OS X 10.3 and later; however, it’s probably unfamiliar to most users. Also called the Action menu, the Action toolbar item provides a quick way to access the Finder’s contextual menus. Select an item (or multiple items) in a Finder window and then click the Action toolbar item; you’ll be presented with a pop-up menu that provides a number of options related to the selected item(s). What these options are will depend on the type of items(s) selected (which is why these menus are called contextual). I’ll talk more about contextual menus later in this chapter.

Path The Path item provides a pop-up menu that shows the path to the current window (i.e., the folder currently being viewed), and allows you to browse to any directory in that path. For example, if you’re currently viewing your home directory, clicking the Path item will show you the full hierarchy of your home directory (Computer Name, Volume Name, Users, username); you can choose any of these items from the Path pop-up menu to switch the window to that directory. (This is the same menu you get if you command-click the title bar icon at the top of any Finder window.)

Eject If you’re browsing the Computer view (the list of all mounted/connected volumes) in a window, selecting a volume and clicking this toolbar item will unmount/eject that volume. This is the same as choosing File Ø Eject.

Burn If you’re creating a CD or DVD using Mac OS X’s built-in disc-burning capabilities (more on that in Chapter 7), selecting a mounted CD-R, CD-RW, or DVD-R and then clicking this item will burn the disc. This is the same as choosing File Ø Burn Disc….

Customize This item simply accesses the Customize Toolbar dialog. (I already covered a few other ways to access this dialog.)

Separator/Space/Flexible Space The Separator item allows you to insert a vertical line to divide the toolbar into sections. It doesn’t “do” anything, but judicious use of separators can make for a more organized toolbar. For example, I put navigation items on the left, then a separator, then quick-access volume/disk items (iDisk, for example), then another separator, and then my own custom items. The Space item simply places a specific amount of space—one item width— between two toolbar items. The Flexible Space item basically pushes any items to the right of it up against the right side of the toolbar. For example, the default toolbar configuration uses a Flexible Space item to ensure that the Search field is always on the far right end of the toolbar.

New Folder This item creates a new folder in the directory you’re currently browsing. It works exactly the same as choosing File Ø New Folder.

Delete If you select an item in a Finder window and then click this button, you’ll move the selected item to the Trash. It’s the same as choosing File Ø Move to Trash.

Connect This item brings up the Connect To Server dialog (which I discuss in Chapters 10 and 11). It’s the same as choosing Go Ø Connect to Server….

Find Clicking this item brings up the Finder’s Find dialog. It’s the same as choosing File Ø Find… (but, as I explain later in this chapter in “Finding Files, Folders, and Information,” different from the Search field).

Get Info Selecting an item in a Finder window and then clicking this item is the same as choosing File Ø Get Info.

iDisk Clicking this toolbar item connects to and mounts your iDisk, using the username and password in the .Mac tab of .Mac System Preferences. (I talk more about these settings in Chapter 9.) You can also access this same command by choosing Go Ø iDisk Ø My iDisk.

The “default set” The final item you can drag to the toolbar is the default set. If you ever want to return to the “stock” toolbar configuration provided by Apple, simply drag this set from the bottom of the dialog to the toolbar; all of your toolbar items will be deleted and replaced by the default set.

Note

Mac OS X 10.2 and earlier had a few other standard toolbar items: Computer, Home, Favorites, Applications, Documents, Movies, Music, Pictures, and Public. Since these are all standard Finder folders that can easily be added using the procedure described in the next section, as of OS X 10.3 they are no longer part of the Customize Toolbar dialog.

Note

You’ll notice that some of the standard toolbar items are simply other ways to do things for which the Finder already has menu commands. In addition, most of these items also have keyboard shortcuts, listed next to each command in Finder menus. The reason I mention this here is that in the next section I’ll show you how to add your own items to the toolbar, so you may want to avoid using too many standard toolbar items in order to save some space for custom items.

The bottom section of the Configure Toolbar dialog includes a pop-up menu to choose how you want to view toolbar items: as an icon with text, as an icon only, or as text only. Note that if you select the text-only view, the View toolbar item will become a menu rather than three buttons, and the Search field will no longer be visible (clicking Search will bring up the Finder’s Find dialog).

After you’ve chosen which items to place in your toolbar, and set your preferred viewing options, click Done; the dialog will disappear, and you’ll be left with your new toolbar, ready to go.

Tip

If you ever get bored with the default icons of standard toolbar items, you can actually change them. Although you could do it manually, the shareware CandyBar (http://www.panic.com/candybar/) does it for you, quickly and painlessly. You can create your own icons or choose from among many icon sets available for download. I talk more about CandyBar in the Online Supplement.

Customizing the Toolbar with Your Own Items
User Level | any
Affects | individual user
Terminal | no

In addition to the standard toolbar items, you can add folders, files, applications, servers—anything that has an icon in the Finder—to Finder toolbars. To do so, simply drag the item’s icon to the position in the toolbar where you want it to appear. After a second or two, you’ll see the familiar OS X “add” symbol appear next to the cursor (Figure 5.10); drop the item to add it to the toolbar.

Note

Although you can manage both custom and standard toolbar items from the Customize Toolbar dialog, you can also move them within and/or remove them from the toolbar without opening the dialog. Simply hold down the command key and either drag items left or right (to change their position) or drag them off/out of the toolbar (to remove them).

Click To expand
Figure 5.10: Adding an item to the Finder window toolbar

Custom toolbar items behave just as they would if you were using them in a Finder window or on the Desktop. Clicking a folder or local volume icon in the toolbar will change the current window to view that folder/volume (as if you’d double-clicked the folder or volume in the Finder to open/view it). When you click a file’s toolbar item, the file is opened—along with the application needed to open the file, if necessary) just as if you had double-clicked the file in the Finder. If you click a toolbar item for a remote volume, that volume will be mounted, if necessary, and viewed, just as if you’d double- clicked an alias to that volume in the Finder. Finally, when you click an application icon in the tool- bar, the application is launched just as if you’d launched it in the Finder.

Finder toolbar icons also have another great feature: They support drag and drop. If you drag a file onto a toolbar application icon, it will be opened in that application. If you drag a file onto a folder icon in the toolbar, the file will be placed inside the folder.

Tip

If you’re using Mac OS X 10.2 or earlier, folder icons in the toolbar also support OS X’s spring-loaded folder feature; drag an item over a folder’s icon in the toolbar and hold it there—a new window for that folder will appear, allowing you to place the file inside any subfolder! (I’ll talk more about spring-loaded folders later in this chapter, in “File and Folder Finesse.”) They also honor the Finder functionality whereby holding the command key when opening a folder will open it in a new window. (In other words, if you have a folder item in the toolbar, command+clicking the folder item will open that folder in a new window, instead of in the existing window.) Unfortunately, at the time of this writing, Apple has disabled this functionality in OS X 10.3 and later. Here’s hoping they add it back in a future update.

Later in this chapter (in “Recommended Toolbar/Sidebar Items”) I’ll provide some recommendations for custom toolbar items that you may find especially useful.

The Sidebar

In Mac OS X 10.3, Apple added a new feature to Finder windows: the sidebar. The sidebar is designed as a place to “store”—and quickly access—files, folders, and applications, both ones that Apple places there and ones that you place there yourself. To open/view/launch an item in the sidebar, you simply click it, just as if it were in the Dock or toolbar. Likewise, if you have a folder in the sidebar, you can place items in that folder by dragging them onto its icon/name in the sidebar. This also works for applications: drag a document onto an application in the sidebar to open it in that application.

Note

If you command-click a folder or volume in the sidebar, it will open in a new window instead of in the current window. Likewise, if you option-click an item in the sidebar, a new window will open (or, in the case of applications, the application will launch or be brought to the front) and the current window will close. Unfortunately, these actions don’t work if the item you click is already being viewed in the current window; you need to switch to another folder or volume in the sidebar first, then command- or option-click the desired item.

In truth, the sidebar is just another way to do things that you could already do using Finder window toolbars and the Dock. (Although that’s not necessarily a bad thing; different people have different preferences and different ways of working, so it’s always great to have more options!) However, toolbars and the Dock both have a few drawbacks when it comes to adding lots of items. The main drawback for the Dock is that it uses file/folder icons—but not names—for quick identification; if you have five folders in the Dock, they all look the same. (You can move the mouse cursor over each item to view its name, as described in the next chapter, but that can be inconvenient.) The main drawback for the toolbar is that since it’s horizontal in its orientation, it can hold only a few items before it gets full. (This is also a problem with the Dock, although it’s not as restrictive a limitation as it is with toolbars.)

The sidebar gets around these issues, mainly because of its vertical orientation: Each item is represented by the item’s icon and name, and items are listed down the left side of every Finder window (provided the toolbar is visible for that window). In addition, much like the Dock, as you add more items—or change the size of the window itself—the sidebar automatically resizes its items (Figure 5.11) in order to fit them all in the current window. (Up to a point: In order to prevent items from becoming so small that they’re no longer practically useful, at some point the sidebar will become a scrolling sidebar so that more items can be added without reducing item size.)

Click To expand
Figure 5.11: The sidebar automatically resizes items as you add more.

The sidebar also has a few other neat features. When you mount a server or removable volume (FireWire hard drive, iPod, etc.), its item in the sidebar will include an Eject button to the right of its name. Simply click this button to unmount the volume—no more dragging volumes to the Trash icon in the Dock or manually choosing File Ø Eject VolumeName. Similarly, if you’re burning a CD or DVD, the disc will show up in the sidebar; when you’re ready to burn, click the Burn button that appears next to it. These sidebar buttons are a real convenience!

In addition to their basic functionality in the Finder, Finder window sidebars have one other significant advantage that I’ll talk more about later in this chapter: They’re replicated, and fully functional, in Open/Save dialogs. So you can quickly switch to a particular location when opening or saving a document by clicking that volume or folder in the sidebar inside the dialog.

Note

One caveat of the sidebar is that if you’re viewing the current window in column view, when you click a folder in the sidebar to view it in that window, the window loses the ability to scroll “up” the hierarchy. I’ll talk about this issue later in this chapter when I discuss column view.

Like the Dock and Finder toolbars, you can customize your sidebars so that they work for you. Read on to find out how.

Customizing Finder Sidebars

There are two ways to customize the contents of your Finder window sidebars: via Finder preferences and by manually dragging items in and out.

Customizing Sidebars Using Finder Preferences

If you open the Finder’s preferences window (Finder Ø Preferences…) and switch to the Sidebar panel, you’ll see a list of “stock” items that you can choose to include in your Finder window sidebars. Check the box next to an item and it will immediately be added; uncheck an item to remove it. Most of these items are self-explanatory, but a few aren’t. Computer provides the same Computer view you access via Go Ø Computer in the Finder. iDisk mounts/shows your iDisk. Network shows the Network browser (discussed in Chapter 11).

In addition to unchecking an item in Finder preferences to remove it from the sidebar, you can also remove an item by dragging it out of the sidebar in any Finder window; in fact, if you do this and then open the Sidebar panel of Finder preferences, you’ll find that the item will no longer be enabled.

Customizing Sidebars with Your Own Items

The best part about the sidebar is that, like the Dock and toolbar, you can customize it to best fit your working style. To add an item—a file, a folder, or an application—to the sidebar, simply drag it into the sidebar area. You’ll see a blue line that shows where the new item will be placed (Figure 5.12); drop the item to add it. (See the “Recommended Toolbar/Sidebar Items” section for a list of some items that you may find especially useful in your Finder window sidebars.) The only caveat is that, like the Dock, the sidebar has two distinct sections. The top section, above the gray line, is for volumes (the Computer and Network views, hard drives, iDisk, connected servers, and removable media); this section is controlled via the Sidebar panel of Finder preferences. The bottom section, below the gray line, is for files, folders, and applications, and can be customized as described here.

Figure 5.12: Adding an item to the sidebar
Tip

You can also add an item to your sidebars by selecting the item in the Finder and pressing command+T (or by choosing File Ø Add to Sidebar).

You can rearrange items in the sidebar by dragging them up or down. To remove an item, drag it out of the sidebar; it will disappear in a “puff” just like items you remove from the toolbar or the Dock.

Tip

I personally use the sidebar as a “To Do list”: While I’m working on a particular project, I keep its folder in the sidebar; when I’ve finished, I remove it from the sidebar. For example, in revising Mac OS X Power Tools, each time I had a chapter to revise or review, I placed its folder in the sidebar in the order it needed to be finished. Not only did this provide me with quick access to each chapter’s files, but it also gave me a visual queue of the tasks I needed to complete.

Customizing Sidebar Size

In addition to customizing which items appear in your Finder window sidebars, you also have some degree of control over how the sidebar appears. The standard width of the sidebar is wide enough to show the icon and name of each of the default sidebar items. However, if you add items with longer names, the sidebar may be too narrow to display those names, instead abbreviating them using ellipses (…). Alternatively, as you add more items to your sidebars, all sidebar items will shrink in size, as explained above, in an attempt by OS X to show all sidebar items at once. The result is that your side- bars may end up being wider than the longest item name, leaving lots of empty space. Whatever the case may be, sometimes you’ll find that your sidebar is too wide or too narrow.

If you find this to be the case, the divider between the sidebar and the main part of the Finder window—the vertical bar with the tiny “dimple” in the middle—actually allows you to change the width of the sidebar. By dragging the divider left or right, you can make the sidebar narrow or wider, respectively. In fact, if you drag the divider to the left just far enough to hide item names, you can make your sidebar display just icons. (There’s actually a “notch” at this location; drag the divider to the left slowly enough and it will stick at the point where only icons are visible.) A nice touch is that if you change the sidebar so that it only shows icons, when you move the mouse cursor over one of those icons, the item name will appear in a floating “tooltip” just to the right.

Tip

If you drag the sidebar divider all the way to the left, the sidebar will disappear completely. (You can accomplish the same feat by double-clicking the divider.) This is the only way to get rid of the sidebar without disabling the toolbar, as well. (Unfortunately, there’s no way to do the opposite—disable the toolbar while still viewing the sidebar.) If you double-click the collapsed sidebar divider, you’ll restore the sidebar to its most recent visible state. (You can also drag the collapsed divider to the right to restore it to the desired width.)

Tip

When you change the sidebar’s contents (by adding, removing, or rearranging items), those changes apply to all Finder windows. However, when you change the size of a sidebar in a window, that change applies only to that particular Finder window. See the “Getting Window Settings to Stick” sidebar—book sidebar, not Finder sidebar—for more information about settings that apply to individual windows.

Recommended Toolbar/Sidebar Items

Below are a number of items that you might not immediately think of putting in your Finder window toolbars and sidebars, but that you might find quite useful once you do. (I’ve noted after each whether it applies to the toolbar, the sidebar, or either.)

“Temporary” folders (sidebar) If you’re temporarily working with a particular folder—opening it frequently or moving other items into it—place it in the sidebar. When you’re done, remove it. This is a great way to keep the folder handy while you’re using it. It’s also a useful way to move an item between two folders: Place the destination folder in the sidebar, and then navigate to the folder containing the item you want to move; you can then drag the item to be moved from the Finder window to the destination folder in the sidebar, and then remove that folder from the side- bar afterward. This is often more convenient than opening two Finder windows next to each other.

Items you want to access in Open/Save dialogs (sidebar) As I’ll explain later in this chapter (in “Super Saving (and Opening)”), Finder window sidebars are replicated in Open/Save dialogs. So even if you don’t frequently access a particular folder when using the Finder, if you access that folder from within Open/Save dialogs, adding it to your sidebar will make it much easier to get to.

Computer (either) The Computer item shows the Finder view that you’d otherwise get to via Go Ø Computer (or by pressing shift+command+C). If you have a number of partitions and/or mounted volumes, this view can be quite useful. You can add the Computer item to the sidebar via the Sidebar panel of Finder preferences. However, if your sidebar is getting crowded and you want to clear up some space, you can instead place the Computer item in the toolbar. In Mac OS X 10.2 and earlier, Computer is one of the items in the Customize Toolbar dialog; getting it in the toolbar in OS X 10.3 is a bit trickier. In the Finder, choose Go Ø Computer (or press shift+command+C).

Then click and hold the Computer title bar icon (which looks like a flat-panel iMac) at the very top of the window; after a second or two you should be able to drag that icon! Drag it to the toolbar as you would any other item. (I’ll talk more about using the title bar icon later in this chapter in “Take Advantage of the Title Bar (‘Proxy’) Icon”.)

Network browser, mounted volumes (either) You can add any of these items to the toolbar for quick access by going to the Computer view and then dragging them to the toolbar. To add them to the sidebar, use the Sidebar panel of Finder preferences. (I talk about the Network browser in Chapter 11.)

Home, Documents, Movies, Music, Pictures, Public (either) Your home folder is most likely the folder in which you spend the most time while using Mac OS X, so it might actually be the most useful toolbar or sidebar item. Alternatively, you can place specific items within your home folder in the toolbar or sidebar. To add any of these items, navigate to /Users and then drag your user folder, or open your user folder and drag the desired folders, to the toolbar or sidebar. (You can also add your home directory to the sidebar by using the Sidebar panel of Finder preferences.)

Favorites (either) I’ll talk more about the Favorites folder later in this chapter (in “Favorite Files and Folders”); adding it to the toolbar or sidebar is a great way to access it quickly.

Applications (either) Since you can’t fit all your applications in the Dock, you’ll need to go to your Applications folder once in a while. Adding it to the toolbar or sidebar is a great way to get there quickly.

Individual applications (either) If you place an application in the toolbar or sidebar, you can use it just like an application in the Dock (except that it won’t have a Dock menu): You can click it to launch it, and you can drag documents onto it to open them in that application. I personally place StuffIt Expander in my sidebar so that I can quickly drag downloaded items from a Finder window onto Expander to “unstuff” them.

AppleScripts (either) If you have any AppleScripts that you use frequently, placing them in the toolbar or sidebar lets you access them quickly and also gives you the ability to drag and drop files onto them no matter where you’re browsing. (Apple has provided a good number of toolbaroriented AppleScripts at http://www.apple.com/applescript/toolbar/; these scripts also work when placed in Finder sidebars.)

Open Terminal in the current directory (either) If you frequently use Terminal, you know that one of the most common inconveniences is changing the current working directory to the one you want to use; it’s also true that you often want to switch to a directory you’re already using in the Finder. By placing one of two excellent utilities, Open Terminal (http://homepage.mac.com/thomasw/OpenTerminal/) or Open Terminal Here (http://www.entropy.ch/software/applescript/), in your toolbar or sidebar, you simply navigate to the desired directory in the Finder and then click the utility’s icon in the toolbar/sidebar. A new Terminal window will open with the active path of the current Finder window. (You can also drag a file or folder onto the utility’s icon in the toolbar or sidebar to open a Terminal window with that file/folder location as the working directory.)

Window Views and View Options

User Level | any
Affects | individual user
Terminal | no

As I mentioned earlier in this chapter, you can view the files and folders in a Finder window in one of three different ways: icon view, list view, and column view. The first two are old hat to Mac OS 9 users; the third is new in OS X. You can switch between views using the View toolbar item (which has buttons for icon view, list view, and column view) or by choosing the appropriate view (“as Icons,” “as List,” or “as Columns”) from the Finder’s View menu.

Tip

You can also switch between views using the keyboard: command+1 for icon view, command+2 for list view, or command+3 for column view.

You can choose different view options for each folder by choosing View Ø Show View Options or by pressing command+J; the resulting View Options palette allows you to select the best viewing options for each window full of files. For example, if you’re looking at a folder of pictures, icon view lets you view extremely large icons, so as to take advantage of graphics files’ icon previews. However, for folders of word processing documents, you may prefer list or column view because they allow you to browse a large number of files in a list. Once you select a view, and view options, for a particular folder (Finder window), the Finder remembers that view and its options, and will use them the next time you browse that folder. (Kind of…see “Getting Window Settings to Stick,” later in this chapter.)

Each view has different options, as well as its own advantages and disadvantages; I’ve included a brief discussion of each below.

Icon View

Icon view has been around as long as the Mac. Its main advantages are simplicity and the fact that you can clearly discern the type of file by its icon. In fact, if you have icon previews enabled in View Options, graphics files that have icon previews will be shown using those previews instead of their default file type icon.

Navigating in icon view is fairly simple. Besides the standard mouse actions, you can select a file or folder by typing the first few letters of its name. You can also move between items, in alphabetical order, by pressing the tab key (shift+tab moves between items in reverse alphabetical order). To open a file or folder, you double-click it (or select it and choose File Ø Open, press command+O, or press command+down arrow). To move up the folder hierarchy, press command+up arrow or command- click the folder name in the window’s title bar. (You can also use the Path item in the toolbar, if it’s enabled.)

These navigation tips may be obvious to you, but I mention them to contrast them with the methods of navigation used in column view, which I’ll discuss shortly.

View Options for Icon View

If you view a folder “as Icons,” the View Options window changes to reflect this (Figure 5.13). The first option—which is present in the View Options palette for all three window views (icon, list, and column) but not for the Desktop—is to select whether the options you set apply only to the current window or to all windows. However, this setting is not quite what it appears to be. What it actually means is “Apply to this window only” or “Apply to all windows of this view type.” In other words, if you’re changing settings for a window in icon view and select “All windows,” those settings will apply to all windows using icon view. The exceptions to the “All” setting are windows for which you’ve specifically set up different settings using the “This window only” setting. Is that confusing? A little bit, but it gives you the flexibility to set system-wide View Options for each type of window view, while still allowing you to have different settings for individual windows (one of the most requested features under older version of the Mac OS).

Figure 5.13: View Options for icon view

The next few settings (“Icon size” through “Keep arranged by”) function identically to the corresponding settings in Desktop View Options, as discussed earlier in this chapter. The combination of a large icon size and “Show icon preview” can be quite useful when viewing a folder of photos, provided those photos have icon previews (Figure 5.14).

Click To expand
Figure 5.14: A folder of pictures viewed using large icon previews

The final option—Background—is unique to icon view. Although window backgrounds are white by default, you can customize the appearance of the window background in icon view (again, for all windows using icon view or for just the current one). If you select Color, and click the color swatch that appears, you’ll be presented with the standard Mac OS X Colors dialog, where you can choose a color using one of several selection panels. (You can switch between these panels by clicking the icons at the top of the Colors window.) From any of the panels you can click the magnifying glass icon to choose a color anywhere on your screen.

Tip

You can save favorite colors that you use frequently in the Colors dialog. First, select the color using one of the color panels. Then click anywhere inside the large rectangle at the top of the window that shows the selected color and drag that color to the grid at the bottom of the window. The selected color will be added to the grid and available from within any application that supports the Colors dialog.

If you select Picture for the Background option, click the Select… button that appears to navigate to your preferred background picture. Unfortunately, OS X won’t automatically resize images to fit windows, so some pictures may be more or less appropriate for use as window backgrounds (some will be much too small, some much too large).

List View

List view has also been a part of the Mac OS for a long time; however, OS X has added a few twists (for the better). It’s still the best view to use for seeing detailed information about a large number of files at once and for easily selecting multiple files for use. It’s also the view mode with the most options for sorting and organizing files and folders.

You navigate in list view much like you do in icon view. In addition to using the mouse, you can select a file or folder by typing the first few letters of its name, or you can move between items by pressing tab and shift+tab. To open a file or folder, you double-click it, or you select it and choose File Ø Open, press command+O, or press command+down arrow. Just as in icon view, you move up the folder hierarchy by pressing command+up arrow or by command-clicking the folder icon/name in the window’s title bar. (You can also use the Back, Forward, and Path items in the toolbar, if enabled.) However, list view also provides the option to view the contents of a folder without leaving the current directory. By clicking the disclosure triangle next to a folder name, the contents of that folder will be shown in a hierarchical list (Figure 5.15). You can even view the contents of any subfolders in the same way. (You can also expand or collapse a folder’s content listing using the keyboard by selecting the folder and then pressing the right arrow key to expand or the left arrow key to collapse.)

Click To expand
Figure 5.15: Viewing a folder’s contents in list view

By clicking a column heading, you can sort by that column (Name, Date Modified, Date Created, Size, Kind, Label, etc.). Clicking a heading a second time causes the Finder to sort by that column in reverse order (reverse alphabetical, older first rather than newer first, etc.). In addition, under OS X you can actually rearrange the order of columns by simply dragging them left or right to the desired location. The only restriction is that the Name column cannot be moved. Finally, you can resize a column by placing the cursor on the right edge of the column heading (until you see the left/right arrow symbol appear); then click and drag the cursor to make the column narrower or wider.

Tip

You can also change the selected sort column using the keyboard by pressing control+tab to move across columns left to right or control+shift+tab to move right to left.

View Options for List View

Like the View Options panel for icon view, the View Options panel for list view (Figure 5.16) lets you apply settings to a particular window or all windows, and you can select the font size for text labels. However, the rest of the settings are unique to the list layout. You have a choice of two icon sizes, both much smaller than most sizes available in icon view. You can also choose which informational columns—and thus how much information—to show in file/folder listings. (If you enable too many columns, you’ll probably spend a lot of time scrolling left and right in order to view all of them, so it’s generally useful to include only the columns for information you use frequently. I usually show only date modified and size.)

The “Use relative dates” setting applies only to Date Modified and Date Created columns. If a date is today or yesterday, instead of showing the calendar date the information will be displayed as “Today” or “Yesterday.” The “Calculate all sizes” option is available only if you’ve chosen to show the Size column; if checked, the Finder will calculate the size of both files and folders in the current list view (it normally only shows file sizes). Although this option can be useful, it slows down the Finder significantly. I use this option only when I really need it, and even then I apply it only to the current window.

Figure 5.16: View options for list view

Column View

Column view, modeled after the file browser in the NeXT operating system, is new to the Mac in OS X, and many users seem to have a love/hate relationship with it. Windows in column view have multiple columns instead of a single pane; when you select a file or folder in a column, its contents are presented in the next column to the right. If you run out of columns, new ones are created and the window scrolls to the right (thus it may be necessary to scroll back and forth to see the entire hierarchy leading to a particular file or folder). Column view has the advantages of letting you quickly navigate through nested directories, instantly see the path to the file or folder you’re viewing (folders in the path are highlighted in gray), and quickly switch to another directory along that path.

Tip

You can resize column width by selecting the column resize tab at the bottom of any column divider; this resizes just the column to the left of the divider. To resize all columns in the current window identically, hold down the option key as you use one of the resize tabs. If you simply want to resize a particular column to fit the longest item name in that column, double-click the resize tab to the right of that column. Holding the option key down as you double-click a resize tab will resize all columns to that width. (Oddly enough, these procedures are all reversed in OS X 10.2 or earlier; you change all columns if you move the resize tab, but you change just a particular column by holding down the option key.)

One of the biggest advantages of column view is the preview column. When enabled in View Options, the preview column—which is basically identical to the Preview panel of Get Info windows—allows you to preview many types of files without opening them. If a text file is selected in column view, the preview column will show a bit of the text of the file. If a graphics file is selected, you’ll see a smaller version of the graphic. But even more impressive is what happens if you select a multimedia file (a sound file or movie file, for example). The preview column (Figure 5.17) presents you with a small QuickTime player that allows you to actually listen to or watch the file’s contents! In addition to the preview itself, the preview column also provides an extensive amount of information about the selected file.

Figure 5.17: The preview column for a QuickTime movie file
Tip

If you have a multi-button mouse and are using Mac OS X 10.2, when previewing a movie file in column view, click and hold on one of the forward/reverse buttons on the right side of the preview player. Then (while still holding the mouse button), right-click. The forward/reverse buttons will turn into a speed/direction slider. Moving the slider to the left of the midpoint plays the movie in reverse (the farther left you move the slider, the faster it plays in reverse); moving the slider to the right of the midpoint plays the movie forward (the farther right, the faster the playback). Unfortunately, this functionality appears to have been removed in Mac OS X 10.3 and later.

Navigating in column view is quite a bit different from navigating icon or list view. Many of the keyboard combinations and menu commands that apply to other views don’t work in column view, because a folder is “opened” simply by selecting it. However, column view has a few keyboard navigation tricks of its own. In addition to selecting files and folders with the mouse, you can use the arrow keys to navigate. The up and down arrows move you up and down the list of items in a column, and you can move between columns using the left/right arrows. Unlike the other views, you can’t move between items using the tab key; however, you can still select an item by typing in the first few letters of the item name. The only caveat is that in column view, in order to select an item by typing, you have to make sure that the column that contains that item is active. You can tell which column is active because it’s the one with an item highlighted in color, as opposed to items highlighted in gray (which indicates the current file path).

Tip

If you want a folder to open in a new window instead of in the next column, command+double-click the folder. It will open in a new window, using the view mode you most recently used to view that folder. (If you’ve never viewed the folder before, the new window will appear in icon view.)

Start Sidebar
Column View: Be Careful What You’re Moving

When you click and drag an unselected file in icon or list view, that item always becomes the active (highlighted) icon. However, when you click and drag an unselected file in column view, this isn’t the case—if another file or folder was previously highlighted, that item will remain so. In other words, a different file or folder may be highlighted than the one you’re dragging. This inconsistent behavior in column view can lead you to move or delete an item that you didn’t intend to—you generally assume that you’re moving the highlighted item. For this reason, when I use column view, I find myself quickly clicking an item first to select it, just to make sure I’m dragging the correct file.

End Sidebar
View Options for Column View

If you select View Options for a window in column view (or click in a window in column view if View Options is already open), you’ll see the panel for column view options (Figure 5.18). You’ll immediately notice how sparse it is compared to the options for other types of windows. As in other views, you can select the text size for item names. You can also choose to show or hide icons. Finally, you can choose to show or hide the preview column. Because of the way column view functions, there’s no need (nor any room) for the kinds of options included in the other views.

Figure 5.18: View Options for column view
Note

If you choose to hide icons in column view, items will be listed only by name. One consequence of this approach is that the only way to differentiate between a file and a folder is the small arrow next to a folder, which indicates that selecting the item will produce a new column for its contents.

Start Sidebar
Column View and the Sidebar/the Toolbar/Go to Folder: “Rooted” Scrolling

As I explained in the main text, one advantage of column view is that you can easily see an item’s location—and navigate to any directory in the path to that item—by scrolling to the left and viewing the hierarchical path to the file; you can navigate all the way up the path to Computer view. At the same time, according to Apple, the sidebar is supposed to simplify file navigation by “rooting” the window at whatever folder was selected in the sidebar. In other words, using the sidebar to switch to a particular directory “breaks” column view—you can navigate up the file hierarchy only as far as your initial location. This issue also occurs in column view in OS X 10.3 when you access a folder via a toolbar item or the Go to Folder command (discussed later in this chapter in “Go Directly to a Folder”).

You can work around this limitation by choosing Go Ø Enclosing Folder (or pressing command+up arrow) until your column view is “unrooted”—the scroll bars will then let you scroll left, all the way to the Computer level.

End Sidebar
Tip

The setting for text size in column View Options actually changes the icon size as well. This is the only view where this is the case, and it means that changing the text size affects the number of items that can fit in each window.

Useful Window Tidbits

User Level | any
Affects | individual user
Terminal | no

I’ve covered most of the major aspects of using Finder windows and browsing directories; however, I still have a few tips that don’t fit neatly into the above discussion. I’ve listed them here under the clever title of “Useful Window Tidbits.”

Start Sidebar
Getting Window Settings to Stick

Although Mac OS X provides a number of options for viewing file directories, and allows you to easily change the size and width of windows, anyone who has used Mac OS X for a while can tell you from experience that figuring out when such settings are going to stick and when they aren’t is often an exercise in frustration—or at least it seems to be.

The logic behind getting OS X to “remember” folder settings is fairly straightforward, but not what you might expect. To put it simply, if a folder or volume has never been opened directly (in a new window), it will open in icon view, using any icon View Options settings you applied to “All windows.” If a folder or volume has previously been opened, the window for that directory will open with the settings that were active the last time it was closed. The key part of that sentence is “the last time it was closed.” If you open a new window for your startup drive, navigate to your personal Documents folder, change the view mode, resize the window, and then close the window, the settings you just changed will not apply to a new window for your startup drive—they’ll apply to a new Documents window.

So to create your preferred settings for a particular folder, what you need to do is open that folder, change your view options, resize the window to the appropriate size, and then close the window. The next time you open that folder, the window will remember your preferred settings.

That is, unless you change anything and then close the window while still viewing that directory…

End Sidebar
Tip

Keep in mind that the Finder is simply an application; as such, tips for working with applications generally apply to the Finder, as well. One of the best features for working with application windows in Mac OS X is Exposé, which I talk about in Chapter 7.

Manipulate Windows in the Background

When you click anywhere on the edges or inside a visible window, that window becomes the active (frontmost) window. However, sometimes you don’t really want to work with a window—you simply want to move it out of the way, resize it, or close it, without making it active. You can actually do this quite easily in OS X. First, you can use any of a window’s title bar buttons—the close, minimize, and resize buttons, and the toolbar widget—without making the window active. Second, if you want to physically move a window (perhaps to view something behind it), simply command-drag anywhere on the window’s “brushed metal” border (or, if you’re using Mac OS X 10.2 or earlier, the window’s title bar) and you can move it, still in the background, anywhere you like. When you release the mouse button, it will still be inactive. (You can also command-drag a window’s resize tab—in the lower-right corner—to resize the window without making it active.)

Clean Up Your Windows

If you find yourself with lots of Finder windows open, OS X provides a nice feature for keeping them organized. The Finder’s Window menu has a “Bring All to Front” item that will bring all Finder windows to the front if they’re hidden behind application windows. However, if you hold down the option key, “Bring All to Front” changes to “Arrange in Front.” Choosing this item stacks your open Finder windows into a neat, cascading arrangement on the screen.

View Long Filenames

Unlike earlier versions of the Mac OS, OS X supports long filenames—up to 255 characters! One drawback of these long filenames is that it’s difficult to view them, especially in list and column views, because column widths are seldom wide enough.

You may have discovered that if you have a file or folder name that is too long for the current column (in column view) or for the name column (in list view), hovering the cursor over the file or folder name for a couple seconds brings up a floating text box with the full text of the name. What you may not know is that if you press the option key and move the mouse cursor over such a lengthy name, the text box will appear immediately.

Take Advantage of the Title Bar (“Proxy”) Icon

At the top of every Finder window you can see the name of the folder or volume being viewed in that window. In addition, just to the left of the window name is a small icon. Although it might appear that this icon exists mainly as a visual aid to help you discern the window type—and that’s quite a useful feature, especially when you have a number of windows open in different applications and the Finder—it also has another use, and that’s as a proxy for the Finder icon of the folder or volume.

What I mean by proxy is that anything you can do with a folder icon in the Finder, you can do with the title bar icon. To select the title bar icon, click it and hold the mouse button for a second. (If you don’t hold for a second or so, you won’t be able to “activate” it.) You can then drag the icon to the Desktop, to another folder, or to another volume. Wherever you drag the icon, the folder itself will be moved (or, in the case of another volume, be copied), just as if you had dragged the folder icon in the Finder. However, also just like in the Finder, you can modify this default behavior by pressing option (to make a copy of the folder in the destination location), command (to move the folder to the destination if it’s on a different volume—I discuss this feature in “Move, Don’t Copy,” later in this chapter—or command+option (to make an alias to the folder in the destination) while dragging the icon. You can discern which will happen by the visual cues OS X provides: A standard cursor arrow means the folder will be moved, an arrow with a green plus sign (+) means the folder will be copied, and a curved arrow cursor means an alias will be created.

When dragging a title bar icon, you can take advantage of spring-loaded folders, which I’ll talk about shortly, to place a folder, or an alias to it, several levels deep in a folder hierarchy. Finally, you can also use the title bar icon in reverse: You can drag files and folders onto the icon to place them in the current window’s directory. This is especially useful when you can see only the title bar of a window (because the rest is obscured behind other windows) or when you want to make sure you’re moving an item into the top level of a window’s folder hierarchy.

Tip

You can also work with the title bar icon in application windows; I talk more about this functionality in Chapter 7.

View/Hide the Status Bar (or Notice It for the First Time)

Every Finder window, regardless of the view mode, has a status bar that lists how many items are in the folder currently being viewed, how many of those items (if any) are currently selected, how much space is available on the volume containing the folder being viewed, and whether or not you have “write” access to the folder being viewed (if you don’t, you’ll see a symbol that looks like a pencil with a line through it).

In Mac OS X 10.3 and later, if the toolbar is visible for a Finder window, the status bar is at the bottom of the window and can’t be disabled. However, under Mac OS X 10.2 and earlier, and in OS X 10.3 and later when the toolbar is hidden, the status bar may not be visible; in fact, you may not even realize it exists. If the status bar is hidden for your Finder windows, choose View Ø Show Status Bar to reveal it—it will appear just above the file listing. (If it’s currently visible, you can hide it by choosing View Ø Hide Status Bar.) This setting applies Finder-wide—you can’t show the status bar for some windows and not others.

Print a Folder Listing

In Mac OS 9 and earlier, you could print the contents of a window by simply selecting the window and choosing a menu item. Unfortunately, Mac OS X hasn’t yet implemented such functionality. Not to worry—here are a few ways you can print a listing of a folder’s contents:

Using the Finder and a text editor If you open the folder in the Finder, you can select all (Edit Ø Select All, or command+A) and then use the copy command (Edit Ø Copy, or command+C) to copy the items to the clipboard. You can then open any text editor or word processor, paste the filenames into a document, and then print the document. The only caveat to this method is that for some reason Mac OS X doesn’t keep file and folder names sorted when it copies them to the clipboard from list or icon views; in order to get a properly sorted list, first switch to column view, and then select all and copy.

Using Apple’s Script Menu If you’ve enabled Apple’s Script Menu (navigate to /System/Library/CoreServices/Menu Extras, and then double- click Script Menu.menu), you can use one of the provided Script Menu scripts to print a Finder window. To do so, choose Script Menu (the menu with the icon that looks like a script or scroll) Ø Printing Scripts Ø Print Window; in the resulting Open dialog, navigate to the folder whose contents you want to print and then click Open. (There’s also a script called Print Window With Subfolders that will print the contents of folders within that folder, as well. If you’re adventurous, you can open one of these scripts in Script Editor and save it as an application; dropping a folder on the new application will immediately print its contents.) The only caveat here is that these scripts only print to LPR printers; you’ll need to set up an LPR printer (as described in Chapter 12) in order to actually print a file listing.

Using Printer Setup Utility If you drag a folder onto Printer Setup Utility (located in /Applications/Utilities), the Printer Setup Utility icon in the Dock (if applicable), or a Desk- top Printer (discussed in Chapter 12), a complete list of the folder’s contents, including the file- name, file size, and modification date of each file, will be printed. This listing will even include invisible files. (If you’re using Mac OS X 10.2 or earlier, you should drag the folder onto Print Center instead.)

Using Terminal If you open Terminal and navigate to the folder in question (or use Open Terminal Here, which I mentioned when talking about customizing Finder window toolbars and side bars), you can use the ls command to list the items in the folder and then copy the resulting output from Terminal into a text editor. (You could also output the listing directly to a file; I’ll talk about that in Chapter 15.) The main drawback here is that the ls command has so many options that it may take you a bit of time to figure out exactly which options you want to use.

Using BBEdit or TextWrangler The excellent text editor BBEdit and its little sibling Text-Wrangler, both mentioned several times in this book, have a built-in disk browser that allows you to view and print file directories. Simply select File Ø New Ø Disk Browser and then navigate to the desired directory. You can print the listing directly from BBEdit or TextWrangler.

Using a Web browser If you drag a folder into most Web browser windows, the browser will present a listing of all the files in that folder, along with information about each file; you can then print this listing.

Using Print Window The excellent shareware Print Window (http://www.swssoftware.com/products/printwindow.html) allows you to print directory listings just as you did under Mac OS 9. When you launch Print Window, it runs invisibly in the background. To print a window or folder, you simply open the folder and then (depending on how you’ve set up the Print Window preferences) press command+P or choose Finder Ø Services Ø Print File Listing. You can also switch to Print Window and select a folder listing you want printed. Finally, you can simply drag a folder onto the Print Window icon to print it. Regardless of the method you use, before the folder listing prints you’re presented with a dialog where you can choose which item information to print (name, kind, size, date modified) and which to use to sort the item listing; whether you want just a list of the top level of files and folders, or a hierarchical listing of all subfolders and files; whether you want to print icons (and if so, what size); what font to use when printing; and which headers you want included (date and/or path to folder listing), if any. Print Window even includes layouts to print CD and DVD covers.

Scroll Vertically

More and more Mac users are using mice and trackballs with scroll wheels. Although these devices are great for scrolling through Web pages or word processing documents, they’re also very useful for scrolling up and down in Finder windows. However, here’s a tip you may not know about: If you hold the shift key down as you use the scroll wheel, Finder windows will scroll left/right instead of up/ down—a great feature for column view, or for list view windows that are too narrow to display all information. This nifty feature also works in some third-party applications.

Scroll with a Hand (Drag Those Windows)

You know that if a Finder window isn’t big enough to show all items at once, you can use the scroll bars to move up, down, left, and right within the window. Here’s a better way for list and icon views: If you hold down command+option and click in an empty area of the window, the cursor turns into a hand that “grabs” the window background. You can then drag the window’s contents up, down, left, and right. If you need to do a lot of window scrolling, this method is often easier on your own hand than using the scroll arrows.


File and Folder Finesse

As someone who’s been using Mac OS X—or even Mac OS 9 or Windows—you’re familiar with the basics of working with files and folders. Dragging files between folders or volumes, double-clicking to launch applications or open files and folders…these are the first things you learn about using a computer. However, in Mac OS X there are many other ways to do these things, and many other things you can do. In this section I discuss what I think are some of the best tips for working with files and folders; I start with contextual menus because I’ll be mentioning them several times in the pages to come.

Contextual Menus

One of the most useful ways to interact with files and folders in the Mac OS is using contextual menus. Yet it’s rare that I find a Mac owner who uses them regularly, much less one who truly takes advantage of their full functionality. Put simply, contextual menus provide you with a list of actions you can perform on a selected object (a file, a folder, an application, the Desktop, etc.). They’re called contextual because the contents of the menu—the available actions—vary depending on the context (i.e., what you’re clicking on).

Contextual menus are accessed by holding down the control key as you click a file, folder, or application icon. (This procedure is commonly known as control-clicking). Alternatively, if you have a multi- button mouse you can simply right-click. A menu will “pop up” that contains the applicable actions. You can see a few examples of contextual menus in Figure 5.19; the menu is clearly different for a file, a folder, a volume, an application, the Desktop, and when you click inside a folder.

Click To expand
Figure 5.19: Contextual menus for a file, a folder, a volume, an application, the Desktop, and inside a folder (from left to right, first row, then second)
Tip

If you’re using Mac OS X 10.3, Apple has made accessing the Finder’s contextual menus even easier, via the Action menu toolbar item. However, whereas normally you control/right-click an item to immediately view its contextual menu, to use the Action menu you must first select an item and then click the Action menu toolbar item.

Although all Finder contextual menus contain the Get Info command and two commands for working with Folder Actions (discussed in the Online Supplement), the rest of the menu is different for each type of item. You can quickly open files, folders, volumes, and applications via the Open command; this is the same as double-clicking the item in the Finder. (Files include an additional Open With submenu that I’ll discuss later in this chapter, in “Opening (Files) With”.) You can also assign a color label to these types of items, move them to the Trash, duplicate them, make an alias to them, and copy them (and later “paste” the item elsewhere—a quick way to copy an item to another location without dragging it).

The menus for files, folders, and applications include a “Create Archive of ‘Item Name’” command; selecting this item leaves the original item as-is but creates a compressed archive, in the Windows- compatible .zip format, in the same location as the original. The contextual menu for an application package lets you quickly view the contents of the package (via the Show Package Contents command), as discussed in Chapter 4. The menu for a removable volume or mounted server will also include an "Eject ‘Volume Name’" item.

If you control/right-click anywhere on the Desktop or inside a folder, the resulting menu is quite a bit different from other contextual menus. You can create a new folder in the current location (on the Desktop or in the current folder, respectively) or, in the case of the Desktop, choose Change Desktop Background… to open the Desktop & Screen Saver pane of System Preferences. Your only other options are the standard Get Info and Folder Actions commands.

These differences clearly illustrate what is meant by the term contextual. But contextual menus aren’t limited to the Finder; many applications also support contextual menus. However, instead of acting on files and folders in the Finder, these menus will allow you to perform actions on the documents or files being used in the application. Experiment a bit by control/right-clicking in various places and in various contexts within your favorite applications; you may be surprised at the additional power and flexibility that exists.

While I’m on the topic of contextual menus, I want to briefly revisit how to add your own contextual menu plug-ins. (I previously covered the topic in Chapter 4 when I discussed installing third-party add-ons.)

Add Contextual Menu Items

User Level | normal or admin
Affects | individual user or computer
Terminal | no

The Finder’s contextual menus provide many useful functions for working with files and folders; however, it’s possible to add a good deal of functionality to these menus by installing what are called contextual menu plug-ins. Some examples of tasks that third-party plug-ins let you perform are viewing folder contents by simply control-clicking a folder, and moving file(s) to a specific location without having to drag them anywhere.

Note

Contextual menu plug-ins don’t affect the contents of the Action menu in Finder window toolbars; the Action menu always provides the basic Finder contextual menu.

You can find new contextual menu plug-ins via the usual Mac software websites such as Version Tracker and MacUpdate. To install a plug-in, simply drag it to /Library/Contextual Menu Items (for use by all users) or ~/Library/Contextual Menu Items (for use only by your own account). (Be sure not to place a plug-in in both locations; this may cause some applications to crash when you try to access contextual menus.) In order to take advantage of the new plug-in, you’ll need to relaunch the Finder. You can do this by forcing the Finder to quit (it will relaunch) or by logging out and then back in.

A few of my favorite contextual menu plug-ins are CopyPath (http://www.bergenstreetsoftware.com/, freeware), Open Subfolder X (http://bubblepop.com/opensub/, freeware), Ittec (http://www.balancesoftware.com/ittec/, shareware), OpenMenu (http://www.artman21.net/product/OpenMenu/index_E.html, shareware), and QuickImageCM (http://www.pixture.com/, shareware). CopyPath lets you control/right-click any Finder item and choose the CopyPath item to copy the item’s complete file path to the clipboard (in either Unix or Mac format). QuickImageCM lets you control/right-click any image file and then view, edit, convert, and/or print it without having to open an application. Open Subfolder X, Ittec, and OpenMenu allow you to control/right-click a folder or volume and get a contextual menu that includes a hierarchical menu of the folder or volume contents—moving the mouse over a subfolder will present the contents of that subfolder, and so on. They’re great ways to quickly navigate to a particular file or folder. For the extra shareware payment, Ittec and OpenMenu provide hosts of other features. Ittec even lets you drag a file out of the aforementioned menu to another location, list the contents of StuffIt archives, move files to the Trash from within folder listings, and much more.

In addition to stand-alone plug-ins, a number of applications and utilities provide their own plug- ins to enhance or access the application’s own functionality. For example, the excellent file utility FileXaminer (http://www.gideonsoftworks.com/filexaminer.html) can install a number of plug- ins that let you quickly change file attributes, get file information, or even force-delete stubborn files.

Tip

Ittec, OpenMenu, and the shareware FruitMenu (http://www.unsanity.com/) also all provide the ability to access contextual menus by holding down the mouse button for a second or so. If you have a single-button mouse, this saves you from having to use both hands to access contextual menus.

My examples of plug-ins by no means compose an exhaustive list; scores of plug-ins are available for Mac OS X, and I’m sure you’ll find at least a few of them quite helpful.

Copying and Moving Files

User Level | any
Affects | individual user
Terminal | no

You know that you can move files between folders, and copy files between volumes, by dragging them. You probably also know that you can select multiple contiguous files in the same directory by shift-clicking them, or multiple noncontiguous files in the same directory by command-clicking them. Here are a few other tips for copying and moving files.

Copy Files/Folders without Dragging

If you view the contextual menu for a file or folder, one of the menu commands is Copy. If you select this menu item, the file or folder (and folder contents) aren’t really copied—they’re simply marked as being able to be copied. If you then control/right-click in an open area inside another folder or volume, the resulting contextual menu will include a new option: Paste “Item Name”. If you choose this item in the menu, the Finder will copy the file or folder to that folder or volume. (The original will remain in its original location.) This is a great way to copy a file to a different location; you don’t have to actually drag it around or worry about having two windows open next to each other. Copy, navigate, paste. Done. Although this feature has been around in Windows for quite a while, it’s new to the Mac in OS X, and it’s a welcome addition.

Tip

You can also access this functionality via the Copy and Paste commands in the Finder’s Edit menu.

Move, Don’t Copy

If you drag a file or folder from one location to another on the same volume, it’s simply moved to the new location. However, if you drag the file or folder to a different volume, it’s copied and the original file or folder remains in its original location. That’s fine, and makes sense, but how many times have you wanted to move a file to a different volume rather than copy it? Under OS 9 and earlier, you had to make a copy and then delete the original; that’s no longer the case in OS X. Simply command-drag the file or folder from one volume to another, and the file is moved instead of copied. (Holding down option as you drag a file or folder still forces a copy—even on the same volume—just as it always has.)

Moving Restricted Files and Changing Protected Directories via Authentication

I mentioned in Chapter 1 that Mac OS X 10.3 uses authentication dialogs to allow you to perform tasks you wouldn’t ordinarily be able to do because of permissions restrictions. When you see such a dialog, entering an admin-level username and password temporarily supersedes these restrictions (much like the sudo command in Terminal).

The Finder also has its own authentication dialogs, which let admin users move (and delete, which is really a form of moving) files for which they don’t otherwise have the appropriate access. For example, if you need to delete a system-level preference file, just drag it to the Trash normally; if you don’t have permission to do so, an authentication dialog will appear (Figure 5.20). After authenticating, the action will proceed as expected. (If you don’t provide a valid admin username and password, or if you click the Cancel button, the action will fail.)

Figure 5.20: The Finder allows you to authenticate restricted actions.

Alternatively, if you try to drag an item into a restricted folder, you’ll see a different dialog explaining that the destination folder cannot be modified. This dialog will actually have a button that reads Authenticate; clicking this button provides an authentication dialog that lets the move/copy proceed.

You’ll notice that sometimes when you try to move a system-level file to the Trash, and especially if you try to move it to a location other than the Trash, the cursor may change to a “copy” cursor (a black cursor with a green and white + symbol), indicating that the file will be copied rather than moved. This occurs because OS X assumes that if you don’t have permission to move something, you really want to copy it. To get around this limitation, take advantage of the previous tip ("Move, Don’t Copy"), and command+drag the item. This forces OS X to move the file (after you authenticate, of course).

Tip

In OS X 10.3.0 through 10.3.2, once you’ve authenticated in the Finder, that authentication remains active— without any further notice—for approximately five minutes. This means that during that time period you could conceivably delete vital system-level files without warning! Apple fixed this obvious snafu in OS X 10.3.3 and later.

Use Spring-Loaded Folders (and Sidebars!)

One OS 9 feature that was sorely missed in OS X 10.1 was spring-loaded folders. Apple restored this functionality in 10.2 and even added a bonus. To take advantage of spring-loaded folders, drag a file or folder onto a folder or volume icon; after a short delay (the duration of which is set in Finder Preferences), the folder or volume pops open in a new window, allowing you to drop the item into any subfolder. In fact, if you hold the item over one of those subfolders, the subfolder will open in a new window (and the previous folder will close). And so on. Using this procedure it’s possible to quickly place a file inside any directory on your hard drive. (If a window is currently using column view, instead of “springing” open a new window, the columns will change to reflect the folder that’s chosen for use—so you navigate columns just as you would normally, except that you drag the item over each subfolder as it appears, rather than clicking each.)

Spring-loaded folders work on the Desktop or in any window. In fact, if a folder opens (or is already open) partly off the screen, dragging a file or folder into the window and holding it will cause the window to actually move so that it’s completely visible!

Tip

Regardless of the delay you’ve chosen for spring-loaded folders in Finder Preferences, you can force them to pop up immediately by pressing the space bar as you drag an item over a folder or volume. In fact, you can actually disable spring- loaded folders in Finder Preferences, and the space bar will still force a folder or volume to spring open. This is a great way to avoid accidental “springs.”

The bonus I mentioned that Apple has provided in OS X is that spring-loaded folders also work for Finder window sidebar items. If you have a volume or folder in your Finder sidebar, you can drag an item over it, and spring-loaded folders will take over. If the current window is using column or icon view, that window will be used to show the contents of the selected folder; if the current window is using list view, a new window will pop open. (In OS X 10.2, spring-loaded folders also work for items in the toolbar; unfortunately, Apple removed this functionality in OS X 10.3.)

Tip

If you choose to hide mounted volumes on the Desktop, putting your hard drive in the sidebar is a great way to still take advantage of spring-loaded folders. If you have multiple hard drives, use Finder Preferences to place the Computer item in your sidebars. You now have a spring-loaded sidebar item that lets you drag a file or folder to any location on any drive.

“Hold” a File or Folder Temporarily

Although Finder toolbars and spring-loaded folders are extremely helpful, there are probably still times when you wish you could stick a file or folder somewhere for a moment. Maybe you need to figure out where you want to put the item, or you need to dig through a bunch of folders to get to that place. Or maybe you want to put something aside for later use. I mentioned earlier in this chapter that if you’re just placing files inside a common folder, you can temporarily place that folder in the sidebar. However, this procedure doesn’t work the other way around—you can’t temporarily place a file in the sidebar and then move it somewhere else. A great little utility for just such a purpose is XShelf (http://homepage.mac.com/khsu/XShelf/XShelf.html). It provides a shelf where you can drag files and folders—or even text, graphics, or URLs from within applications. Items remain on the shelf until you remove them. Although XShelf doesn’t seem like a big deal, if you move items around a lot, it’s one of those things that makes you wonder how you ever worked without it.

Open (Files) With

User Level | any
Affects | individual user
Terminal | no

Although you can open files by double-clicking them, or by dragging them onto an application’s Finder or Dock icon, Mac OS X provides the ability to open a file, using any application, from the file’s contextual menu. If you control/right-click a file, one of the options is Open With; if you move the cursor over this item, a list of applications that can open the file will appear, along with the item “Other…” Choosing an application will open the file in that application. If the application you want to use to open the file isn’t listed, choose Other… and you’ll be able to browse to your preferred application. (This option gets used more often than you might think, as sometimes OS X isn’t very good about listing all the applications that might be able to open a file.)

Tip

If you control/right-click a document and then press the option key after the contextual menu pops up, the Open With option changes to Always Open With… This feature permanently changes the application association for this particular file.

Open With… Using Zingg!

User Level | any or admin
Affects | individual user or computer
Terminal | no

Although Mac OS X’s Open With functionality is very useful, you can improve on it using the freeware contextual menu plug-in Zingg! (http://www.brockerhoff.net/zingg/). Zingg! adds its own Open With contextual menu item, but allows you to customize it. Instead of letting OS X guess which items might be able to open a file, you can choose which applications appear (and don’t appear) in the submenu. You can also choose to only show Classic applications when the Classic environment is running. I hope Apple will add this functionality in future versions of Mac OS X; for now, Zingg! is a great addition.

Go Directly to a Folder

User Level | any
Affects | individual user
Terminal | no

It’s fairly easy to get to specific directories and files in Mac OS X; as mentioned earlier in this chapter, column view is especially useful for such purposes. In addition, using aliases, the Dock, or other launching utilities discussed in Chapter 6 and the book’s Online Supplement, you can keep frequently used files and folders at your fingertips. However, there may be situations where you know exactly where a file or folder is and you want to get to it as quickly as possible. Mac OS X has a great feature for these situations, called Go To Folder. You can access it from the Finder by choosing Go Ø Go to Folder… or by pressing shift+command+G. You’ll be presented with a dialog (as part of the frontmost Finder window, or in a separate dialog window if no Finder windows are open), into which you can type the exact path to the Folder you want to access. (You need to type the full path, starting with / or ~/; for example, to go to your Document folder, you’d type /Users/username/Documents or ~/Documents.) Click Go and the current Finder window (or a new one, if none are open) will open to that folder.

Tip

To speed things up, or if you don’t know the exact name or spelling of a directory, the Go to Folder dialog box features auto-completion. Type in the first few letters of a folder, and then press tab; if there’s only one folder in that directory that starts with those letters, the rest of the directory name will be filled in automatically. For example, to get to the main Utilities folder, you could type /Ap <TAB> Ut <TAB>—the first tab would complete /Applications and insert the trailing /, and the second tab would complete /Utilities and insert the trailing /. Hitting return would then go directly to the Utilities folder. (Note that this feature won’t work if you've enabled the "Turn on full keyboard access" option in the Keyboard Shortcuts tab of Keyboard & Mouse preferences—with this option enabled, the tab key is instead used to cycle through dialog fields and buttons.)

This feature is also an excellent way to get to hidden directories. For example, if you wanted to get to the /etc/httpd/users directory, which is normally hidden in Finder windows, you’d simply choose Go Ø Go to Folder…, type /etc/httpd/users, and then click Go; you’d be taken directly to that folder.

In addition to the Go to Folder command, the Finder also has the following keyboard commands for folders and views that are likely to be accessed frequently:

Computer | shift+command+C
Home | shift+command+H
Network | shift+command+K
iDisk (your own) | shift+command+I
Applications | shift+command+A
Utilities | shift+command+U
Tip

(These commands are also available via the Go menu.)
Tip

You can access the most recent folders you’ve opened by using the Go Ø Recent Folders submenu in the Finder.

Alias Action

User Level | any
Affects | individual user
Terminal | no

Most Mac users have encountered aliases—shortcuts or placeholders that point to another file or folder—and many users take advantage of them frequently. If you’re working on a file, you can create an alias to the file on your Desktop for easy access (while the file itself remains in its original location). You can also create a folder full of aliases to frequently accessed files and folders—in fact, that’s exactly what the Favorites folder in OS X is. (I talk about Favorites a bit later in this chapter.) You can even create aliases to connected servers while they’re mounted; the next time you want to access the server, you can just double-click the alias instead of going through the Connect To Server dialog.

If you’ve never created your own aliases, doing so is easy: You simply select a file or folder in the Finder and then choose File Ø Make Alias (or press command+L). You can also control/right-click the file or folder—or select it and then click the Action menu item in the Finder window toolbar— and choose Make Alias from the contextual menu. An alias to the file or folder is created next to the original, which you can then move anywhere you like. Double-clicking the alias is exactly the same as double-clicking the original file. You can also drag and drop aliases onto folders and applications, and drag other items onto folder and application aliases, just as you could the original files.

Tip

If you hold command+option as you drag a file to another location, when you release the mouse button an alias to the file will be created there, leaving the original untouched. This is a great shortcut for placing an alias in a location different from the original file.

If you want to find out where an alias’s target (the original file) is located, select the alias and then choose File Ø Show Original (or press command+R), or choose Show Original from the alias’s contextual menu. A new folder will be opened showing the original file’s location, with the file highlighted. (If the file is on the Desktop, it will simply be highlighted.) Deleting an alias doesn’t affect the original file in any way.

Although aliases provide a good deal of functionality on their own, here are a few other alias tricks you might find useful.

Use the Desktop as Your Home Folder

User Level | admin
Affects | individual user
Terminal | yes

Although I’ve always been the type to keep documents and personal files inside the Documents folder (even under OS 9), I’ve met many Mac users who use the Desktop as their primary work- space—they keep their files, folders, everything out on the Desktop. In fact, I’ve talked to quite a few users who don’t like the fact that their account in Mac OS X is centered around their home folder. If you’re one of these people, this tip is for you—you can actually change your home folder from ~/username to the Desktop.

  1. Navigate to /Users, and select your home folder.

  2. Create an alias to your home folder on the Desktop (hold command+option as you drag it to the Desktop).

  3. Move anything currently on the Desktop into your current home folder by dragging it onto the alias you just created.

  4. Drag the newly created alias into your home folder.

  5. Open Terminal (make sure you’re in your home directory by typing cd ~ <RETURN>), and then type mv Desktop Desktop.Backup <RETURN>. This renames your original Desktop folder to Desktop.Backup (and keeps it handy if you change your mind about this procedure later).

  6. Again in Terminal, type mv aliasname Desktop <RETURN>, where aliasname is the name of the alias to your home folder that you created above. This step renames the alias that you previously created to Desktop. As you know by now, the Desktop is simply a folder called Desktop in your home folder, so what you’ve just done is made the alias to your home folder the Desktop—thereby making the Desktop your home directory.

  7. Log out and then back in to take advantage of the changes you just made. When you do, all of the items previously on your Desktop will be there again, along with all of the folders in your home directory.

Tip

If you previously set your Web browser or any other application to save files to the Desktop, after using this tip you should update those settings to save to your home folder.

How Do I Go Back?

If you decide you want to go back to the standard home/Desktop setup, it’s pretty quick and painless.

  1. Open Terminal, and type rm Desktop <RETURN>. This command deletes the alias to your home folder that you previously named Desktop.

  2. Again in Terminal, type mv Desktop.Backup Desktop <RETURN>. This renames the backup of your Desktop folder back to Desktop.

  3. Log out and back in. Your Desktop will be back to normal. Well, almost—it will be empty at first. You need to move any Desktop files you had previously moved to your home folder back to the Desktop. (Remember to reset your download settings in your Web browser and any other applications, if you had previously changed them for this tip.)

Open Groups of File, Folders, and Applications at Once

User Level | any
Affects | individual user
Terminal | no

This is just a quick tip that expands on the idea of aliases. If you want to quickly open a group of files, folders, or applications (or a combination of the three), you can create aliases to them and put them in a folder or on your Desktop. When you want to open them, you can select all of the aliases at once and double-click them (or choose File Ø Open, or choose Open from their contextual menu).

That works fine, but it’s kind of messy. And if you have several groups of aliases, you’re looking at an even bigger mess. It turns out that several developers have created convenient solutions for such scenarios. The freeware utility HotAlias (http://www.trufsoft.com/) and the shareware apps AliasMultiplier X (http://www.ziksw.com/) and Multiple Launcher X (http://www.naratt.com/MultipleLauncher.html) all allow you to create single documents that, when launched, open a group of files, folders, URLs, and/ or applications. Although these utilities are each a bit different, they all use a similar interface: You drag a combination of files, folders, applications, URLs—any type of Finder item—into a document window, arrange them in the order you want them to launch, and then save the document. Opening that single document in the Finder launches/opens all the files inside.

These utilities are great for opening groups of files for a project—they work especially well at login. For example, in writing this book I needed Word, OmniOutliner, DEVONthink, TextEdit, a Web browser, and various Finder folders open. I created a launch document that opened everything at once, and placed it in my Login/Startup Items in System Preferences. When I logged into my account, everything was ready and waiting for me.

Favorite Files and Folders

User Level | any
Affects | individual user
Terminal | no

I mentioned in the previous section that you can create a folder of aliases to frequently accessed files and folders in order to provide quick access to these items. Mac OS X actually provides a standard folder for such a purpose. This feature is called Favorites and is one that many users don’t take advantage of. Unfortunately, support for this feature varies depending on what version of Mac OS X you’re using.

The Favorites feature uses a folder called, appropriately enough, Favorites, located at ~/Library/Favorites (meaning each user has their own). If you have a particular folder or file that you find yourself accessing frequently, you can add it to your Favorites folder. In OS X 10.3 and later, you do this by selecting the item in the Finder and then holding the shift key down and choosing File Ø Add To Favorites (or by pressing shift+command+T). In Mac OS X 10.2, you don’t need to hold the shift key down (for either the menu command or the keyboard command). Regardless of the version of Mac OS X, what this does is creates an alias to the actual item and then places that alias in the Favorites folder. (You can also add an item to the Favorites folder manually by dragging the item or, preferably, an alias to the item to the Favorites folder.)

In Mac OS X 10.3, the Favorites folder is mainly useful if you add it to Finder window sidebars. This way you can quickly access items, and place items, in the Favorites folder. Using spring-loaded folders, you can also drag files into subfolders and even onto application aliases in the Favorites folder. In addition, since the sidebar shows up in Open/Save dialogs, the Favorites folder in the side- bar provides a quick way to get to frequently used items when opening and saving files.

In Mac OS X 10.2, you lose the ability to use the sidebar, but the Favorites feature is a bit more functional in and of itself. You can quickly access the Favorites folder in the Finder by choosing Go Ø Favorites (or pressing shift+command+F). Even better, you can instantly access individual items within the folder by choosing Go Ø Favorites Ø item name (a submenu appears showing the contents of the Favorites folder). Finally, if you customize Finder toolbars as discussed earlier in the chapter, one of the toolbar items is Favorites. If this item is in your toolbar, you can click it to instantly go to the Favorites folder; better yet, you can drag items onto the Favorites toolbar item to place them in the Favorites folder (hold down command+option to instead place an alias to the item instead of the original).

In addition, in OS X 10.2 you can also access your Favorites in the Open/Save dialogs of Mac OS X–native applications. When you click the navigation pop-up menu in these dialogs, you’ll see a section called Favorite Places that lists the folders inside your Favorites folder. So if you place aliases to the folders where you most frequently save files to and open files from, you can go directly to them from within Open/Save dialogs. (You can also add folders to your Favorites from within these dialogs by clicking the Add to Favorites button.)

Finding Files, Folders, and Information

It’s easy to get to files and folders in Mac OS X—assuming you know where they are. But what about those times when you know a file’s name, or part of its name, but you’re not sure where you put it? What if you can’t remember a file’s name, but you remember some of the text you included in it? Or what if you need to find all of the files on your hard drive that mention a specific report you’re working on? Fortunately, OS X provides solutions to all of these dilemmas.

Find Files Faster

Mac OS X provides three ways to find files: Search, Find, and Locate. You’re probably thinking, “Don’t those mean exactly the same thing?!” Well, in English, almost, but in OS X, not at all. Here’s how they differ and when you’d want to use one over the others.

Search
User Level | any
Affects | individual user
Terminal | no

The Search function is accessible only via Finder window toolbars; it’s one of the stock toolbar items. By default, the Search function searches only the contents of a window and any folders and subfolders in that window. (Or, if you’ve selected a folder within the window, it searches just the contents of that folder.) In other words, if you know a file resides somewhere inside your Documents folder, you can navigate to your Documents folder and then type the name of the file (or part of the name) in the Search field; the search will begin as soon as you start typing. (The OS X 10.3 Finder uses the same type of “live” searching that’s used by iTunes; in OS X 10.2 and earlier, you’ll need to press return to initiate the search.) The Finder window will switch to what looks like List view, except that the window will be divided into two panes. The top pane lists the results of your search—all files within the selected folder that match your search criteria. If you select a file from the list, the bottom pane shows you the path to it (where it’s located). If your search results are too narrow, you can delete characters from your search term, or change it; the results window will update in real time.

Tip

The path pane (the lower pane of the results window that shows the path to a selected file) is resizable by dragging the divider between the two panes. If you make the path pane larger, the path will be presented as a hierarchical folder path. If you make it smaller, the path will be reduced to a horizontal representation of the path.

If, instead of searching within the current folder or selected folder, you want to search your entire home folder, local hard drives, or all volumes (including mounted volumes and servers), click the magnifying glass icon next to the Search field. You’ll be presented with a pop-up menu that lets you choose the focus of the Search field’s search (Figure 5.21).

Figure 5.21: Changing the focus of the Search field

Once you’ve started a search, you can use any file in the top (results) pane just as if it were a file in a standard Finder window: You can open, move, copy, delete, Get Info, etc. You can even control/ right-click the item to view its contextual menu. You can also open the enclosing folder for the item by choosing File Ø Open Enclosing Folder (or pressing command+R). The actions you can perform in the lower (path) pane are much more limited; you can double-click the item to open it, or double- click any folder in the path to open that folder. You can also use the File menu to perform certain tasks such as Get Info, Move To Trash, and Add To Sidebar/Favorites.

Once you’re done with your search, simply click the Back toolbar item to return to the previous (pre-search) window.

Note

As of the time of this writing, if you open the Trash and try to use the Trash window’s Search tool, you’ll always get no results. To search the Trash, you’ll need to use the Find feature described in the next section.

Find
User Level | any
Affects | individual user
Terminal | no

The Finder’s Find function is what most users probably think of when they think about finding files. You access this feature in the Finder by choosing File Ø Find… (or by pressing command+F); you’re presented with a new Find window. Find is much more powerful than Search in that you can search specific places—or a combination of specific places—for files using a variety of criteria.

The “Search in” pop-up menu lets you choose to find files anywhere on all mounted volumes (Everywhere), on Local disks (meaning it will not search connected servers), in just your Home folder, or in Specific places. Selecting the last option presents a new pane where you can add and remove volumes or specific folders on volumes. All mounted volumes are listed; check the box next to those you want to search within. You can also add individual folders (useful for limiting your search to specific directories) by either dragging those folders into the pane or clicking the Add button and then navigating to the folders in the resulting Open dialog.

Note

To remove a volume or folder from the Specific places list, select the item and then click the Remove button; alternatively, if you just want to omit an item from the current search, uncheck it. However, you shouldn’t try to just drag the item out of the list (as you would with a sidebar, Dock, or toolbar item); at the time of this writing, doing so will actually move or copy the item to wherever you drag it! I personally consider this to be a bug; I hope Apple will fix it in a future update.

The default search criteria are “Name contains” and “Content includes.” However, you can change the options here to find ever-more specific combinations of criteria (Figure 5.22). Click the leftmost pop-up menu to change the category of that line’s search criterion: Name, Content, Date Modified, Date Created, Kind, Label, Size, Extension, Visibility, Type, or Creator. Most of these criteria are self-explanatory; however, I’ll talk about “Content includes” a bit later in this chapter (in “Find Files by Their Content”). Depending on the type of criterion, you’ll see a second pop-up menu, a text field, or both; these options let you designate the specific information for which you want to search for each criterion (text in the name or content, date ranges, type of item, etc.).

You can add additional criteria using the plus (+) buttons on the right; you can choose different criteria, multiple iterations of the same criterion, or a combination. To remove a particular search condition, click the – button next to it. (Note that Mac OS X remembers your search conditions; the next time you open the Find dialog, it will provide the options used for your most recent Find operation.)

Figure 5.22: A complex Find
Note

If you use the “Name ends with” criteria, don’t forget that many files in Mac OS X end with a file extension (such as .xxx). These file extensions are considered part of the file’s name even if the extensions are invisible (as discussed earlier in this chapter). So if you have a PDF file named Document, a search for "Name ends with ment" may or may not find that file, depending on whether the file’s actual name is Document or Document.pdf.

Once a Find is completed, the results will appear in a window that looks exactly like the results window from the Search function, and you can work with items in the window in exactly the same manner. In fact, you can still use the Search toolbar item to search within the results of your Find! (If the toolbar isn’t visible in the results window, you’ll have to make it visible first.)

Tip

In OS X 10.2, if you click the word Search in a Finder window toolbar (just below the Search field), the Find window opens. Most users wouldn’t give this a second thought, but since you now know the difference between Search and Find, it should seem a bit odd. Regardless, it’s a convenient quirk in that placing the Search item in the toolbar gives you quick access to both features. Unfortunately, this trick only works in OS X 10.3 and later if you’ve chosen to view the toolbar as Text Only.

Locate
User Level | any (admin to update)
Affects | individual user (update affects computer)
Terminal | no

As a Unix-based system, Mac OS X can keep track of every file on your hard drive via the Unix locate database. On a periodic basis (via Unix maintenance scripts that I’ll talk about in Chapter 14), OS X updates this database to keep it current. You can access the locate database in Terminal using the locate command; you can narrow your searches using the Unix tool grep. (I’ll talk more about grep in Chapter 15.)

You’re probably wondering why you’d ever use locate, or need to worry about grep, when the Finder’s Find function works so well. One reason is that the Find command actually searches your drive(s) each time it runs, so it can take a while (sometimes a long while) to find files. Since the locate database already exists, the locate command produces results almost instantaneously. Another reason is that there are some excellent tools out there that allow you to take advantage of the locate database without dealing with Terminal. My favorite is the freeware Locator (http://www.sebastian-krauss.de/software/).

Locator provides a graphical interface to the locate command (Figure 5.23); you simply type in a word or string of words and press the Start button, and it searches the locate database for matching files. You can tell Locator to search specific volumes or folders by typing in a path in the In field or by choosing it from the pop-up menu next to the field (enable the Recursive option to search within subfolders). Note that the locate database is case-sensitive; if you want Locator to ignore the case of your search terms, check the Case Insensitive box. (What is actually happening is that Locator is searching the locate database for all possible combinations of case; this means that case-insensitive searches will take more time than case-sensitive ones, but may find more results.)

Figure 5.23: Locator provides a nice interface for the locate command.
Tip

If you’re a grep expert, but prefer the interface of Locator, you can have your cake and eat it, too. Choose Grep from the Locate pop-up menu, and then type your grep expression in the search field. You can also check the Regular Expression box to use regular expressions.

I mentioned previously that the locate database is updated periodically; the one disadvantage this has is that it’s not “up-to-the-minute” up-to-date. If you want to make sure that your search will catch even the newest files, choose Database Ø Rebuild Locate Database… This forces OS X to update the database. (You can view the date and time of the last update at the bottom of the Locator window.)

Locator has many other features that I simply don’t have the space to cover here. A few quick examples: it can search for contents of packages, it can create special databases of removable volumes and media (so you can search for files on CDs or Zip disks even if they’re in a closet), and it can index and search the ID3 tags of MP3 files.

Find Files by Their Content

User Level | any
Affects | individual user
Terminal | no

What if you need to find a file and you don’t know its name, but you do know a few words of its contents? Or what if you’re trying to gather information for a report and you need to find every document on your computer that mentions a certain topic? The Find function of Mac OS X has an additional criterion called content that lets you find files based on their contents. To take advantage of this feature, open a Find window in the Finder, and choose “content” from the search criteria pop-up menu. You can choose to search only by content by removing any other criteria, or you can further limit the search by adding more criteria.

The one caveat to finding files by content is that for it to work, you first need to index files. The first time you search the content of files in a folder, Mac OS X will automatically index that folder’s contents first; however, that process does slow down the search process. To speed up your content searches, you can “pre-index” entire volumes, or you can choose to index individual folders. Select a volume or folder, choose File Ø Get Info (or press command+I), and then click the disclosure triangle for the “Content index” panel (Figure 5.24). You’ll see whether or not the folder or volume has ever been indexed and, if it has, when the index was last updated. Click the Index Now button to index the volume (or to update the existing index, if the folder or volume has already been indexed—a good idea if it’s been a while since the index was created), or click the Delete Index button to delete the existing index.

Figure 5.24: The Content index panel for a folder

The Finder doesn’t actually index every word in a file; rather, it indexes what it considers to be important or identifying words—words that you’d be likely to use when trying to locate each file. When I discussed Finder preferences earlier in this chapter, I mentioned that you can choose which language(s) the Finder uses when indexing volumes or folders. This affects content searches because the Finder indexes what it considers to be known words, so if you don’t tell it to use Spanish, for example, it won’t index Spanish words, and thus you won’t be able to find by Spanish content (but the index files themselves will be much smaller).

Note

Indexes are located at the root level of each indexed folder, in an invisible file called .FBCIndex.

Prevent Files from Being Indexed
User Level | admin
Affects | computer
Terminal | no

Indexing files takes quite a bit of time, and the indexes themselves grow in size the more files are indexed, so it may be preferable to you to index just those files, and just those types of files, you’re likely to want to search. Inside /System/Library/Find are text files that tell the Finder what gets indexed and what doesn’t. By launching a text editor as root, you can edit these files to allow more files and folders to be indexed or to further restrict indexing.

SkipFolders This file contains a list of folders that won’t be indexed. By default, it contains only root-level directories. However, you can add directories to the end of the list, one per line, to prevent them from being indexed. For example, to prevent the Shared user folder from being indexed, add Users/Shared. (If you add a line with just /, you’ll prevent any indexing of any contents of the boot volume.)

StopExts This file contains a list of file extensions that won’t be indexed. You can add your own to the end of the list; for example, I do a lot of statistical work, and the data files for the Stata statistical environment end in .dta. I’ve added .dta to the end of the StopExts file on my computer so that these data files don’t get indexed.

StopTypes The StopTypes file works just like the StopExts file, except that instead of listing file extensions, it lists file types (the four-letter file type identifier I talked about at the beginning of this chapter). Add file types to prevent those files from being indexed, or remove file types to allow those types of files to be indexed.

Third-Party Find by Content
User Level | any
Affects | individual user
Terminal | no

One of the advantages of indexing is that content searches occur quickly. However, a disadvantage is that you have a content index in each indexed folder; for some folders these indexes become quite large. Another disadvantage is that your search will only be as good as your most recent index—if a directory being searched hasn’t been indexed in a while, you’ll need to wait for the index to be updated before the search can commence. As an alternative, you can search for files by content (and by filename, for that matter) without indexing using the freeware EasyFind (http://www.devon-technologies.com/download.php). EasyFind works much like Locator, but it has a simpler interface. You can choose to search files, folders, files and folders, or file contents. You can choose various Boolean options (and, or, phrase, wildcard, or operator). Finally, you can choose case sensitivity, whether or not to search inside packages, and whether or not to include invisible items in your searches.

Since EasyFind doesn’t use content indexes, it’s quite a bit slower when searching for content within many files and folders. However, I’ve found that it’s still quite fast, and it’s a nice utility to have around.

Undo

This tip is one of the shortest in the book, but it’s such a major feature, and one that so few people really know about or remember, that it deserves its own section.

Short and sweet: The Finder in Mac OS X has an “undo” function. If you accidentally move something somewhere, place a file in the Trash that you didn’t want to place there, or pretty much do any Finder action you wish you hadn’t, choose Edit Ø Undo (or press command+Z), and it will be undone. Write this tip down somewhere in plain sight, because it’s difficult to remember when you’re panicking :-)

Warning

You can’t “un-empty” the Trash using the Undo command. That’s why it asks you, by default, if you’re sure you want to do it.


Super Saving (and Opening)

You’ve surely used OS X’s Open and Save dialogs many times; they’re one of those things that are a normal part of everyday computer use. However, chances are you’re not taking advantage of all the features they provide. Here are some tips for getting the most out of them and how to add the features you’ve always wanted.

Note

Most of the tips in the next few sections apply to Mac OS X–native applications. They won’t apply to Classic applications or to some Carbon applications that don’t take full advantage of the OS X interface. (I’ll talk more about application types in Chapter 7.)

Navigating Open and Save Dialogs

User Level | any
Affects | individual user
Terminal | no

Using Open/Save dialogs is one of those skills that no one ever really teaches you to do; you just figure it out as you go along. Here are a few tricks—some basic, some more advanced—that I hope will help you open and save better.

In the discussion that follows, I’m assuming that in your Save dialogs, you’ve clicked the large dis- closure triangle on the right side of the dialog to expand it to its full, “file browser” view. (See the sidebar “Open vs. Save Dialogs” for more information.)

Tip

If you’re coming to Mac OS X from OS 9, one nice change you’ll notice is that each document has its own Save dialog, rather than one dialog for each application. This has two advantages. First, if you have multiple documents open in an application, this makes it clear which document is actually being saved. Second, it means that you can work in other documents in the same application while a Save dialog is open.

Pretend It’s the Finder

The most basic thing to remember when using Open and Save dialogs—especially in Mac OS X 10.3 and later—is that in many ways they work just like the Finder (Figure 5.25). You can browse files and folders using column or list view (you use the “toolbar” buttons, or command+2 or command+3, to switch between the two views), and you have the same Back/Forward buttons you have in Finder windows. The pop-up menu at the top of Open/Save dialogs shows the path to the current file or folder.

Figure 5.25: In OS X 10.3 and later, Open/Save dialogs (top) closely resemble Finder windows (bottom).
Tip

The “path” pop-up menu in Open/Save dialogs sometimes includes a useful Recent Places section that lets you quickly switch to the most recent folders you’ve accessed from within the dialogs.

You can even use Finder window sidebars within Open/Save dialogs to quickly navigate to particular folders and volumes. (One difference: files included in Finder window sidebars are hidden in Open/Save sidebars; this is a nice touch in that it provides more room for folders and volumes.) This is why I recommended, earlier in this chapter, placing folders in the sidebar that you frequently access when opening and saving.

A number of Finder keyboard shortcuts also work in Open/Save dialogs. For example, you can create a new folder inside the directory being browsed in an Open/Save dialog by pressing command+shift+N; you can then save a document inside the new folder, if desired. You can also quickly switch to the Computer/Home/Network/Applications views using the same keyboard shortcuts you use in the Finder (shift+command+C/H/N/A, respectively).

Basically, if something works in the Finder, remember that there’s a good chance it will work in Open/Save dialogs, so give it a try!

Quickly Access the Desktop and Documents Folders

If you want to open a file that’s on the Desktop, or save something to the Desktop, pressing command+D in any Open/Save dialog will immediately switch the file browser to your Desktop folder.

If you frequently open files from, and save files to, your Documents folder, you’ll find that in most applications, your Documents folder is selected by default when you access an Open/Save dialog. However, if not, and if you want to get there quickly, press command+D in any Open/Save dialog to go to your Desktop folder. Then just press the down arrow (assuming the file browser is active; if not, click the disclosure triangle to reveal it first, and click anywhere in the browser to make it active); this will quickly change the focus of the dialog from Desktop to Documents. (If you’ve created additional folders in your home directory that fall between Desktop and Documents, you may need to press the down arrow more than once.) This procedure isn’t perfect, but until Apple provides a keyboard shortcut for Documents, it’s a decent workaround.

Start Sidebar
Open vs. Save Dialogs

The default view for Open dialogs differs from Save dialogs. Open dialogs have only the “file browser” view discussed in the main text. Save dialogs, on the other hand, have a “minimized” view, which can be expanded to the full (file browser) view via a large disclosure triangle on the right side of the dialog. Once expanded, a Save dialog functions identically to an Open dialog.

In its minimized view, however, the Save dialog has a couple significant differences. The obvious one is that you can’t browse folders and volumes. However, the more subtle difference is that the pop-up menu, which is a “path” menu in expanded view, is called a Where menu in minimized view; instead of providing the path to the current directory, the Where menu includes all volumes and folders that are in Finder window sidebars. This means that even though you can’t browse your hard drive, you can still save documents directly to those volumes and folders, which are presumably places that you access frequently.

End Sidebar

Open Multiple Files at Once

Many OS X Open dialogs will allow you to open multiple files from a single directory at once. Simply shift-click to select contiguous files, or command-click to select noncontiguous files, and then click the Open button.

Resize Dialogs

This is another basic one, but one that seems to shock users when I point it out to them. The default Open/Save dialog shows two columns of files, each able to show 8 to 10 files. But if, like me, you have a lot more than 10 items in your Documents folder, or you tend to open or save files from and to directories that are several levels down, you end up scrolling up/down/left/right in the dialog quite a bit. To fix this, simply grab the lower-right corner of the dialog and stretch it as wide and long as you want. The longer the dialog, the more files it will be able to show, and as you make the dialog box wider, more columns will be added. Your preferred size will be set as the default for that application.

Tip

In some applications, you can also resize columns in Open/Save dialogs using the same procedures you use for resizing columns in Finder windows (as discussed earlier in this chapter).

Drag and Drop Folders

The “obvious” way to access a file or folder in an Open or Save dialog is to use the dialog’s file browser to navigate through your hard drive to get to the item. However, if the folder you’re trying to browse to is viewable in the Finder, drag it from the Finder to the dialog; the browser will immediately switch to that folder. You can then save your file to that folder, or open a file that resides inside the folder. (You can also drag a file to an Open dialog to switch to its enclosing folder and highlight it; click Open or press the return key to open it immediately.)

In fact, if you always prefer to use the Finder or another quick-access method to navigate, you can hide or minimize the document or application that’s displaying the Open/Save dialog, navigate to the destination folder in the Finder, show the document or application again, and then use this tip to access that folder.

View Long Filenames

If a file or folder name is too long to fit in the current column width, you can resize the column to accommodate the full name of the item. However, just as with Finder windows, you can hold the cursor over the file or folder; its full name will appear in a small text box that floats above the window. (Holding the option key down will often make the text appear immediately.)

Save Using the Same (or a Similar) Name as an Existing File

Sometimes you’ll want to replace an existing file with one you’re saving, or save a document using a name similar to one used by an existing file. In OS X 10.2 and earlier, you had to type the name manually. However, in OS X 10.3 and later, Apple added an old Windows trick to Save dialogs: Navigate to the existing file, and then click it in the Save dialog’s file browser; it’s name will appear in the Save As: field. You can either save your document immediately to replace the existing file, or change the name slightly to save it as a different file. Either way, you’ve saved yourself some typing.

Navigate Using the Keyboard

Although the feature is a bit quirky in its current implementation, you can actually use the keyboard to navigate Open/Save dialogs. In both list and column view, type the first few letters of a file or folder name to highlight it; alternatively, you can use the up/down arrows to navigate to the file or folder.

If the selected item is a folder, you can press the right arrow key in column view to move to the next column (the contents of that folder). In list view, pressing the down arrow key expands the folder to view its contents. You then again use the up/down arrow keys, or type a few letters of the desired file/folder name, to select the appropriate item. And so on.

Once you’ve selected a file to open, or a folder to which to save, press return to open or save the file.

Note

In Save dialogs, sometimes you need to press the tab key to switch the “focus” of the dialog from the “Save As” field to the file browser.

Navigate Using File Paths (Go to Folder)

Mac OS X 10.2 and earlier included a “Go to” field in Open dialogs that closely resembled the Finder’s “Go to Folder” command. Although it appears that this feature is missing from Mac OS X 10.3 and later, it’s actually still there, and in fact it’s available in both Open and Save dialogs! The trick is that it can only be accessed via the keyboard. In fact, you have two ways to access it. The first is to use the same command you use in the Finder: shift+command+G. The second, even easier, is to simply begin typing the path to the desired folder or file; as soon as you type the first character of the path (~ or /) OS X will automatically recognize that you’re trying to type a path. In either case, the "Go to the folder" field will appear. Type the path to the folder enclosing the file you’re trying to open, or the path to the location to which you’re trying to save a file, and then click the Goto button.

Although I don’t use this feature often, I do use it when I want to access hidden folders (those that are usually invisible in Open/Save dialogs). For example, from TextEdit’s Open dialog, if you type /etc in the "Go to the folder" field and press the return key, you’ll be able to access and open any file in the /etc directory (which is usually inaccessible).

Open/Save Dialog Delight: Default Folder

User Level | normal or admin
Affects | individual user or computer
Terminal | no

Although the previous tips make browsing Open/Save dialogs much more pleasant, these dialogs still have a long way to go before they work the way they should, in my opinion. If you spend a lot of time opening or saving files, take a look at Default Folder X (http://www.stclairsoft.com/). Default Folder X adds a bunch of very cool features to all Open/Save dialogs; here are some of my favorites:

  • It provides a menu listing all open Finder windows—you can select one of those folders (or any subfolder within one of those folders) from the menu and the Open/Save dialog switches to that folder.

  • When in an Open/Save dialog, you can click any open Finder window to immediately switch to that window in the dialog.

  • It remembers the last document/folder you accessed in each application.

  • You can get information on a file or folder (using the Finder or your favorite file utility) from within Open/Save dialogs. You can also rename and delete files directly, without having to leave the dialog.

  • It provides menus for recently accessed folders and Favorite folders.

  • It provides a volume menu that lets you quickly switch to any mounted volume; the menu also shows the available space on each volume before you try to save to it (Figure 5.26).

    Figure 5.26: Default Folder’s volume menu

  • You can view invisible files in Open dialogs by holding down the option key as you access the dialog.

  • If you’ve navigated to a folder in an Open/Save dialog that you want to open in the Finder, you can easily do so via the Default Folder menu in the dialog.

  • It provides a universal menu in the menu bar that lets you quickly access files and folders, including a list of folders recently accessed from within Open/Save dialogs.

Default Folder is a utility that I consider to be a required part of any Mac that I use.


Moving On...

Team LiB

Moving On…

The Finder is and always has been the center of action on any Mac; however, in Mac OS X the Dock is its partner in crime. In the next chapter I’ll cover using the Dock, getting the most out of it, and using enhancements (and alternatives) to it.

P.S. If after reading this chapter, you’re thinking, “Wow, that was a lot of great info about the Finder!,” remember to check out the Online Supplement (a.k.a. Chapter 5, Part II). I’ll show you how to get even more out of the Finder by adding menus, working with filenames, automating the things you do the most, and changing the overall appearance of Mac OS X. I’ll also tell you how to overcome a few of the most common Finder foibles.


Chapter 6: Developing a Dynamite Dock

(Or: Using the Dock, Dock accessories, and Dock alternatives.)

Overview

The Dock is probably the most recognizable—and controversial, if the discussion of it around the Internet is any indication—element of Mac OS X. If the Finder is the center of Mac OS X activity in general, as I proposed in Chapter 5, the Dock is the center of application-related activity. It provides a straightforward way to launch applications, access application options, monitor application status, switch between running applications, and switch between windows within each application.

However, the Dock’s functionality goes beyond just working with applications. It also lets you “store” Finder and application windows you aren’t currently using and, set up properly, lets you quickly access files and folders. It provides all this functionality in an interface that’s intended to be accessible and easy to understand.

That said, because it tries to remain simple to use, and it appears to be a fixture that can’t easily be replaced, the Dock has taken more than its fair share of criticism. Users want additional features, better organization, easier customization, and quite a bit more. If the sheer number of Dock add-ons, alternatives, and outright replacements available around the Internet is any indication, a lot of users just aren’t happy with their stock Dock. In this chapter, I’ll cover how to take advantage of what the Dock can do, and provide you with some solutions for the things it can’t.


Dock Settings and Customization

Despite the fact that every promotional picture you see of the Dock seems to look exactly the same, the Dock is actually quite flexible. OS X lets you change a few Dock settings via the Dock preferences pane, and third-party utilities provide a way to access a number of settings that aren’t officially available (yet).

Note

Like the Finder, the Dock is simply an application that OS X sets up to always be running. If you quit it, or if it crashes, it will automatically relaunch.

The Dock Preferences Pane

User Level | any
Affects | individual user
Terminal | no

Like most other OS-related settings, you choose your Dock options in System Preferences (Figure 6.1). The first option, Dock Size, lets you choose the default size for the Dock. However, what it really sets is the maximum size of Dock icons. At the smallest setting, Dock icons will be 16 ´16 pixels, regardless of how few or many items you have in the Dock; at the largest setting, Dock icons will be a maximum of 128 ´ 128 pixels. The reason I emphasize maximum is because the Dock will never extend past the edges of the screen; if you have more items in the Dock than will fit on the screen at the chosen icon size, the Dock will automatically resize itself (and therefore resize Dock icons) to fit the screen.

Figure 6.1: The Dock preference pane

The Magnification setting allows you to see Dock items at larger sizes, even if you choose a small Dock Size or if you have so many items in the Dock that it scales Dock items down to smaller sizes. If Magnification is enabled, when you move the mouse cursor over the Dock, the items directly beneath the cursor will be magnified (to the size determined by the Magnification setting). The quality of these magnified Dock icons is impressive; even more impressive is that windows that are minimized to the Dock remain “live”—whatever was going on inside the window at full size continues when the window is minimized (Figure 6.2). (I’ll talk more about minimizing windows in a bit.)

Figure 6.2: A QuickTime movie playing in the Dock
Note

Want to make Dock magnification really big? First turn magnification on in Dock preferences, and then change the size (it doesn’t matter where you set it; you just need to move the slider a bit for this procedure to work). Then open the Dock preference file (~/Library/Preferences/com.apple.dock.plist) in a text editor and find the line that says <key>largesize</key>. The next line is the maximum magnification size (the number enclosed by <real> and </real>). Change the number to something much bigger—try 512 for the largest possible—save your changes, and then quit the Dock; it will relaunch on its own. (If you don’t know how to quit the Dock, I’ll show you later; for now you can just log out and then back in instead.) You’ll see some really big Dock icons! When you’re done wowing your friends, you can use the Magnification slider in the Dock preference pane to change back to a normal size.

The “Position on screen” setting simply places the Dock on the left, right, or bottom edge of the screen. (Under OS X 10.2, this means the edge of the main display; however, in OS X 10.3, it means the edge of the entire Desktop, so if you have multiple monitors, choosing Right will place the Dock at the rightmost edge of the rightmost display.) The “Minimize using” setting changes the effect you see when a window is minimized to the Dock. To see the chosen effect, click the yellow minimize button in any window’s title bar. The Genie Effect is a slower, genie-in-the-bottle action, whereas the Scale Effect is more of an immediate action that simply shrinks the window. The Genie Effect is very cool, but if you’re like me, after the first few times you just want to get the window out of the way so you can get to work. A third effect, the Suck In Effect, also exists, but it’sonly available using a third-party utility such as TinkerTool. I’ll talk about that in the next section.

Note

Set the “Minimize using” option to Genie Effect, and then minimize a window while holding down the shift key…very cool, eh?

“Animate opening applications” bounces applications in the Dock as they’re opening. Although some people find this feedback useful, I prefer to disable it; the pulsing arrow beneath the application icon is good enough feedback for me.

Note

Disabling the animated opening of applications will stop the icon bouncing that occurs when an application launches; however, it won’t prevent the “alert” bounce that occurs when an application is trying to get your attention. If, like me, you find the alert bounce annoying, check out the freeware Dock Detox (http://www.unsanity.com/haxies/dockdetox/).

Finally, if “Automatically hide and show the Dock” is checked, the Dock hides itself off the edge of the screen (bottom, left, or right) until you move the mouse against that edge, at which point it pops up. If you’re desperate for screen real estate, this can be a helpful option.

You can also access most of the Dock’s settings from the Dock item in the Apple Menu and from the Dock itself. If you hold the mouse button down on the divider line in the Dock (the line that divides application icons from icons for files, folders, and the Trash), you’ll see a set of up/down arrows. Drag the mouse away from the edge of the screen to increase the size of the Dock (and therefore the Dock’s icons); drag the mouse toward the edge of the screen to make the Dock smaller. (Holding down the option key as you do this forces the Dock to resize in specific intervals based on icon size: 16 ´ 16, 32 ´ 32, 64 ´ 64, 128 ´ 128.) If you control/right-click the divider line, you’ll get a Dock menu that contains many of the other Dock settings. Finally, you can move the Dock between the three screen positions by shift-clicking the divider line and then dragging it around the screen.

Hidden and Special Dock Preferences

In addition to the settings in the Dock preferences pane, there are a few other settings that actually exist in OS X but haven’t been officially implemented, as well as a few ways in which you can alter the Dock application itself to get it to behave differently. You can access some of the hidden settings via Terminal, but the easiest way is to using the freeware TinkerTool. More advanced options are available via the shareware TransparentDock, and you can give the Dock a complete makeover with the shareware Skin a Dock.

Hidden Dock Preferences via TinkerTool

User Level | any
Affects | individual user
Terminal | no

I’ve already talked about TinkerTool (http://www.bresink.com/osx/TinkerTool.html ) a few times in the book; its Dock settings screen provides access to a few hidden settings. My favorite option, "Use transparent icons for hidden applications," changes the appearance of an application’s Dock icon when the application is hidden (by using the Hide command in the application menu or by pressing command+H). When this option is enabled, a quick glance at the Dock tells you which applications are running but hidden. The second check box, "Enable Dock shadow," simply enables a shadow around the Dock, much like the shadows around OS X windows and menus.

Note

You can also make the Dock icons for hidden applications transparent by opening Terminal and typing defaults write com.apple.dock showhidden -bool true <RETURN>. To turn the effect off, type the same command but substitute false for true.

The Position, Placement, and Minimizer Effect settings are similar to those in the Dock preference pane; however, each adds a few options not available normally. You can position the Dock at the top of the screen; have it start at the corner of the screen instead of the middle (so it expands at one end rather than in two directions); and select a new minimize effect, Suck In. The Suck In Effect is a nice compromise between the boring Scale Effect and the slow Genie Effect.

After making any changes, click the Relaunch Dock button to relaunch the Dock using your new settings.

Customizing the Dock Using TransparentDock

User Level | admin
Affects | computer
Terminal | no

TransparentDock (http://www.freerangemac.com/) provides access to the same hidden settings as TinkerTool, plus it lets you alter additional built-in settings that aren’t normally available. Although some of these settings—those that simply edit the Dock’s preference file—don’t require admin access, some actually alter the Dock application and thus require you to authenticate. In addition, when you first attempt to make certain changes, TransparentDock will ask you if you want to back up your current Dock—by all means, do. If your customized Dock ever presents you with problems, you can use the "Reset from Backup…" option in the Reset Dock tab to restore the original Dock.

The number of appearance options available from TransparentDock’s Custom Dock tab is impressive. You can change the following:

  • The translucency and color of the Dock background (hence the name of the application). (If you skip ahead to Figure 6.4, you’ll see an example of a transparent Dock.)

  • The color of Dock borders and the application triangle (the triangle that shows up below an application that’s currently running).

  • The “poof” action that occurs when you remove an item from the Dock.

  • The size of text used to show an item’s name when you move the cursor over it.

Tip

You can get custom “poofs” from http://www.resexcellence.com/user_poofs.shtml. The donation- ware xDock (http://www.xnation.net/products/xdock.html) will even download and install "poofs" for you. Finally, you can also create your own "poofs" using any graphics application that supports the PNG format.

In addition, TransparentDock provides a number of options for Dock functionality in the Dock Setup tab (Figure 6.3). Some are self-explanatory, but a few aren’t. In Single Application Mode, only the active application is visible (all other applications will be hidden). If Show Background Only Applications is enabled, any application that usually runs invisibly in the background will show up in the Dock. (Be careful with this option; since you can quit applications from the Dock, this option gives you the opportunity to easily quit background applications. However, one reason some applications run in the background is because they aren’t supposed to be quit. Plus, if you enable this option, your Dock can end up getting very cluttered.) If you disable Float Dock Above Other Applications, the Dock will act like a normal window, which means that it won’t “float” on top of other windows—no more windows obscured by the Dock!

Figure 6.3: Dock Setup options in TransparentDock

Two of my favorite options are to put the Quit menu item in the Finder’s Dock menu and in the Dock’s pop-up menu. There are times when you want to quit the Finder—for example, as discussed in the previous chapter, when you change the visibility of a file. This option lets you simply control/ right-click the Finder’s Dock icon and select Quit from the resulting menu. Likewise, there are times when you may want to quit the Dock (if you changed the maximum Dock icon size, as described earlier in this chapter, you needed to quit the Dock for the change to take effect). Enabling this option allows you to quit the Dock from its own pop-up menu, which I discussed earlier.

The Show Package Contents and Show Hidden & System Files options apply only to folders and volumes placed in the Dock—they determine what will or won’t appear in the Dock menus for fold- ers or volumes (discussed a bit later in this chapter in “Dock Menus”). Finally, the two Exposé options are similar to settings I discussed in Chapter 5 when I covered Exposé.

If all this functionality doesn’t justify the meager shareware payment for TransparentDock, once you pay you can also save Dock configurations as themes. Instead of manually changing individual settings, you can simply switch between saved themes (groups of settings).

Skinning Your Dock Using Skin a Dock

User Level | any
Affects | individual user
Terminal | no

Finally, if customizing the Dock’s appearance using its built-in options isn’t enough for you, the preference pane Skin a Dock (http://www.ittpoi.com/sad.html) lets you completely change the Dock’s appearance using skins (Figure 6.4). It comes with a few skins of its own, and it allows you to download new skins automatically as they’re added to the Skin a Dock website. (You can also download new skins manually from http://www.iheartny.com/xicons/dockskins.php; however, if you download skins manually you also need to install them manually.) Unfortunately, at the time of this writing, Skin a Dock is only compatible with OS X 10.2; I hope a version for OS X 10.3 and later will be available soon.

Tip

In addition to customizing your Dock using the tools discussed in this chapter, you can also change the stock Dock icons. For a good tutorial, visit http://downloads.xicons.com/. (The actual URL for the tutorial keeps changing, so you may have to explore the site a bit to find it.)

Click To expand
Figure 6.4: Dock-o-rama: the stock Dock; a transparent Dock created using Transparent-Dock; and a Dock skinned using Skin a Dock (top to bottom)


Using and Abusing the Dock

If you’ve spent any time at all working with Mac OS X, you already know the Dock basics: Any application that’s running shows up in the Dock (with a triangle beneath it to indicate that it’s running), as do any applications or files you add yourself (or, if you haven’t modified the Dock in any way, any applications that were already in the Dock when you first booted into Mac OS X). You can click any application icon in the Dock to switch to that application or to launch it if isn’t already running, and you can click any file or folder in the Dock to open it. Simple, right? Yes, it is, and that’s part of the beauty of the Dock, especially for new users. However, if your Dock expertise doesn’t go much beyond these basics, you’re not taking advantage of all the features and power that the Dock provides. In the following sections I’ll show you these features and how to get more out of them.

Accessing and Using Dock Items

User Level | any
Affects | individual user
Terminal | no

I’ll talk about customizing the Dock’s contents shortly, but first I want to make sure you’re aware of everything you can actually do with an item once it’s in the Dock. As you’re surely already aware, clicking an item in the Dock is just like double-clicking it in the Finder: An application in the Dock will launch (or, if it’s already running, will be made active); a file in the Dock will be opened using whatever application is associated with it; and a folder or volume in the Dock will open in a new Finder window.

In addition, all Dock items support drag-and-drop. If you drag a file onto an application’s Dock icon, the application will attempt to open that file—this is one of the easiest ways to open a file in an application other than the one it’s associated with (for example, to open an Acrobat PDF file in Preview). If you drag any kind of item onto a folder or volume in the Dock, it works just as if you dragged the item onto that folder or volume in the Finder (only without the spring-loaded folders).

Dock Menus

One of the least-used features of the Dock is Dock menus. Every item in the Dock has its own Dock menu, accessed by control/right-clicking the item’s Dock icon. (You can also access such a menu by click-holding the cursor on the Dock icon; after a second or so, the menu will pop up.) Regardless of the type of item, this menu contains a Show In Finder command that will open a new Finder window to the actual location of the item (the Dock icon is simply a representation of the item, kind of like an alias).

If the Dock item is a folder or volume, its Dock menu also includes a hierarchical listing of everything inside that folder or volume, allowing you to quickly access any item within it.

If the Dock item is an application that’s currently running, its Dock menu also includes the following useful items:

  • A Quit command. Selecting this item lets you quit the application immediately, even if it isn’t the frontmost (active) application. (If you have unsaved changes, you’ll be given the opportunity to save them before quitting.)

Tip

If you hold down the option key when accessing an application’s Dock menu, the Quit command changes to Force Quit; this is a convenient alternative to the Apple Menu’s Force Quit command since you can force quit the offending application directly.

  • A Hide command (in OS X 10.3 and later). Selecting this item lets you hide a particular application so that its windows aren’t in your way. What’s especially useful about this item is that, normally, to hide an application you have to first switch to that application and then press command+H (or select Hide from its application menu). Having the Hide command in applications’ Dock menus means you can quickly hide an application that isn’t the frontmost (active) application. In addition, holding down the option key as you access any application’s Dock menu changes Hide to Hide Others, letting you quickly hide all other applications instead! (If you’re running OS X 10.2 or earlier, you can add the useful Hide item to application Dock menus using TransparentDock, discussed earlier, or the freeware Hide From Dock, available from http://gwenhiver.net/applications/hidefromdock/index.php)

  • A list of currently open windows within the application. This is a great way to switch directly to a specific window in a specific application, even if you can’t see it on your screen, without having to first switch to the application and then use the application’s Window menu.

Tip

Because the Finder is an application, it follows that the Finder’s Dock menu will always include a list of open Finder windows; select one to bring it to the front immediately.

In addition, many applications take advantage of the Dock’s menu capabilities to add their own menu items. For example, Figure 6.5 shows the Dock menu for iTunes; you can see what track is currently playing, rate it for future reference, or control iTunes directly from the Dock menu. This is very handy when iTunes is hidden behind the application in which you’re currently working. Try control/ right-clicking the icons of other applications when they’re running—you’ll find that quite a few have their own customized Dock menus. (Many applications also take advantage of their Dock icon to add functionality. For example, the CD-burning software Toast,—discussed in Chapter 7, shows the progress of a burn as part of its Dock icon.)

Figure 6.5: iTunes’ Dock menu

Customizing the Dock’s Contents

User Level | any
Affects | individual user
Terminal | no

One of the great things about the Dock is that although it comes preconfigured out of the box with the applications most people will use, you ultimately decide exactly what it will look like. Here are a few tips for customizing its content.

Note

As I showed you in Chapter 1, you can limit a user’s capabilities in the Accounts pane of System Preferences. If you’ve disabled “Modify the Dock” for a user, that user won’t be able to modify the Dock’s contents.

Left Side versus Right Side

You’ve probably noticed that the Dock is split into two sections by a thin vertical line. Apple’s official names for these two parts are…the left side of the Dock and the right side of the Dock. (You’d think they would have come up with something a bit more clever, no?) If you’ve ever wondered what the difference is, it’s actually rather simple: The left side of the Dock is for applications, and the right side of the Dock is for files, folders, volumes, and minimized windows (and the Trash, of course).

Adding Items to the Dock

Adding items to the Dock is as easy and intuitive as could be: Just drag an item from the Finder to the Dock (applications to the left side; files, folders, and volumes to the right), and existing Dock items will politely move out of the way to make room for the new item. If an application is already running and you want to keep it in the Dock, control/right-click the application’s Dock icon, and then select “Keep in Dock” from the resulting Dock menu. (You can also drag the application’s Dock icon to any other position in the Dock; the application will then remain in the Dock at that position after you quit it.)

Tip

Often when you attempt to drag an item onto a Dock icon (for example, to open it with an application, or to drop it into a folder, that’s already in the Dock), the Dock thinks you’re trying to add the item to the Dock, and the existing Dock icon will move out of the way. As you drag the item back and forth, the Dock icon keeps moving out from under the mouse. (It’s kind of like that hallway “I’m trying to get past you, but we look like we’re dancing” routine.) You can prevent this—and make sure you’re dragging onto a Dock item—by holding down the command key as you drag. This effectively locks Dock icons in their places as long as you hold down the command key.

Removing Items from the Dock

Removing an item from the Dock is even easier than adding it: Drag the item’s Dock icon anywhere outside of the Dock, and release the mouse. The item will disappear in a puff of smoke. (This is the “poof” I mentioned earlier that you can customize using TransparentDock.) Note that if you drag a running application out of the Dock, its Dock icon will snap right back—because the Dock shows all running applications, you can’t completely remove an application while it’s running. However, after you quit the application, it will indeed be removed from the Dock.

Question Mark in the Dock?

At some point you’ll most likely see a question mark in the Dock where there was previously an application, file, or folder. This is the Dock’s way of telling you it can no longer find that item. Perhaps you deleted the item, or maybe you moved it to a different volume. On rare occasions it can even happen for seemingly no reason at all (although the cause is generally a bad Dock preference or mild disk corruption). To update the item, drag the question mark off of the Dock to get rid of it, navigate to the actual item in the Finder, and then drag the actual item back onto the Dock. (If you’re not sure what the item was, place the cursor over the question mark; even though the Dock item no longer works, it still presents the name of the item that was there before.) If you no longer want the item in the Dock, you can just drag the question mark off to delete it.

Accessing Files Quickly

You can drag any file into the right side of the Dock for quick access. However, chances are you want to do this with more than just a single document or file, and, well, the Dock only has so much room. A better approach is to drag folders to the Dock. In Chapter 5, I showed you how to add your Desk- top to the Dock; you can use the same procedure to add any other folder as well. For example, you can place your Documents folder or your Home folder in the Dock; control/right-clicking the folder icon gives you a hierarchical menu of the folder’s contents (and any subfolder’s contents, and so on). Another approach that I use is to create a folder called In Progress, into which I place aliases of all the documents or folders for projects on which I’m currently working. I can then access any of my work in progress quickly and easily.

Finally, you may remember from the previous chapter that the Favorites folder (~/Library/Favorites) stores aliases to any files or folders you’ve designated as a Favorite from the Finder. If you put your Favorites folder in the Dock, you can add any file or folder to your Favorites folder (and, thus, to its Dock menu) by selecting the item in the Finder and pressing shift+command+T (command+T in OS X 10.2 or earlier), or by holding the shift key down and selecting File Ø Add to Favorites (in OS X 10.2 and earlier, you don’t have to use the shift key).

Using Dock Items “in the Finder”

In addition to the basic functionality I’ve been talking about, a nifty trick is that you can actually drag items from the Dock to work with them just as you can in the Finder. The procedure is similar to the one discussed previously for removing items from the Dock; however, instead of just dragging an item out, you need to press (and hold) the command key before you drag the item. When you do this, the item’s Dock icon remains in the Dock, and a “copy” is dragged out instead—you can use this icon just like you would an icon in the Finder.

For example, you can drag a folder or file that’s currently in the Dock onto an application (in the Dock or the Finder) to process the file(s) with that application. You can drag a file, folder, or application from the Dock to the Desktop or a folder or window in the Finder to move it to that location. You can even use the key combinations I covered in Chapter 5 to copy (option) or make an alias to (command+option) the item.

Tip

You can use this trick to drag an application’s Dock icon onto another application—in the Dock or in the Finder— to “open” the former in the latter (for example, to open an application as root using Pseudo, as described in Chapter 1).

Preventing Applications from Appearing in the Dock

Normally you want running applications to appear in the Dock. However, if you have an application that you wish didn’t appear in the Dock when it’s running—for example, because it doesn’t require any user interaction, and it’s just taking up Dock real estate—the freeware Dockless (http://homepage.mac.com/fahrenba/dockless/dockless.html) can help. When you launch Dockless, it lists all applications on your Mac, along with a checkbox next to each that specifies whether that application is displayed in the Dock when running. Uncheck the desired boxes, and click Apply Changes; the next time you launch the modified applications, the Dock won’t even know they exist.

However, there’s a major caveat to using a utility such as Dockless in this manner. OS X determines which applications appear in the Dock via a setting that makes applications run in either background or foreground mode. Background applications don’t appear in the Dock, but they also don’t provide menus! Therefore, if you change an application so that it doesn’t appear in the Dock, you lose all menu functionality, as well. This means you should really only use this trick on applications that don’t require a lot of user interaction.

Showing Mounted Volumes in the Dock

To take the “folder in the Dock” approach one step further, you can also drag any mounted volume to the Dock and get an instant, hierarchical menu of its contents. This can also be quite helpful if you like to have your Dock positioned on the right side of your display—you can place your hard drive in the Dock and then choose to hide mounted volumes in Finder Preferences.

The only drawback to this approach is that you have to manually place mounted volumes in the Dock when they mount and manually remove them if they’re unmounted or ejected. If this is a hassle for you, the freeware preference pane DockDisks (http://www.charlessoft.com/) will do the work for you.

Keeping Troubleshooting Utilities in the Dock

This is more of a tip than a customization, but it deserves separate mention. Every once in a while you may find that the Finder crashes or freezes, and you can’t get it to quit or restart on its own. Generally you could use the Force Quit option in the Apple Menu to quit the problem application, but that may not be possible if the Finder is the application having the problem. However, the Dock often still functions in these situations. If you keep the Activity Monitor utility and/or Terminal in the Dock, you may be able to use one of them to force the Finder to quit, and it will relaunch on its own. (I’ll talk more about force quitting applications in Chapter 7.)

Dock Storage: Minimizing Windows

You can hide any application by using the Hide command in the application menu (or by pressing command+H). The problem with this feature is that often you don’t want to hide the entire application and all its windows; you may just want to get one or two windows out of the way. In Mac OS 9, you could simply double-click a window title bar, and the window would roll up like a window shade (in fact, the feature was actually called WindowShade); Mac OS X no longer provides this feature by default. What it does provide is a way to shrink windows down and place them in the Dock (called minimizing). You can minimize any window by clicking the yellow minimize button in the upper-left corner (or by pressing command+M). The window will shrink into the Dock using the effect you selected in Dock preferences.

Tip

To minimize all windows in a single application at once, hold down the option key as you click the minimize button. This even works for windows in the Finder.

When a window is minimized to the Dock, it looks just like a miniature version of itself (Figure 6.6); in fact, if you have magnification turned on, you can move the mouse over it to see a larger view. (I showed you this earlier in the chapter when I talked about Dock preferences.) Most minimized windows will also have a small badge icon that indicates the application to which they belong; applications with Apple’s “brushed metal” look will simply show a small version of the window. Figure 6.6 shows minimized windows for QuickTime Player, the Finder, and Microsoft Word.

Figure 6.6: Windows minimized to the Dock

To get your window back to full size again, just click its minimized Dock icon; it will grow back to its original size and position. (If the minimized window is the only one open in an application, clicking the application’s Dock icon will also restore the window.) If you have multiple windows for the same application minimized, option-click the minimized Dock icon for one of them to restore them all.

Tip

If you’ve minimized windows for an application and you then hide that application, the minimized windows will appear to vanish from the Dock. Don’t worry, they’re still there; as soon as you unhide the application, its minimized windows will reappear in the Dock. (You can also access them directly by accessing the hidden application’s Dock menu.) In fact, if you find that minimized windows are starting to take up a lot of Dock space (this happens to me with minimized Finder windows), you can hide the offending application (including the Finder) to temporarily hide the Dock icons for that application’s minimized windows.

If you want to close a window that has minimized to the Dock, try control/right-clicking (or click-holding) its minimized icon in the Dock; in some applications, such as the Finder, the resulting Dock menu will include a Close command that closes the window immediately. This saves you from having to restore the window to its normal size in order to close it.

Bringing Back the Window Shades

If you decide you’re really not a fan of this whole minimize-to-Dock thing, and you really, really liked the way Mac OS 9’s WindowShades worked, you can get that functionality for all windows and applications in OS X by installing the shareware preference pane WindowShade X (http://www.unsanity.com/haxies/wsx/). With WindowShade X installed, you actually get your choice of "get the window out of the way" behavior: You can windowshade the window, hide the entire application, minimize the window to the Dock, minimize the window "in place," or make the window transparent (great for just peeking behind a window for a moment). In fact, you can invoke any of these five behaviors for any window. (It even gives you the cute WindowShade sound from OS 9.)

Dock/Keyboard Shortcuts and Commands

I’ve already mentioned a few of the things you can do with the Dock using combinations of modifier keys and the mouse; you can also invoke a number of other actions using modifier keys; I discuss them all here, as well as the Dock’s own keyboard-based application switcher.

Keyboard-Enhanced Actions

The list below provides a summary of the various actions you can perform from the Dock using keyboard modifiers. Some of them I’ve mentioned elsewhere in this chapter, but I mention them here in the interest of compiling a complete list:

  • Control/right-clicking a Dock item (or clicking and holding the mouse button down) brings up its Dock menu.

  • Option+control-clicking (or, if you have a multi-button mouse, option+right-clicking) a Dock item often reveals additional Dock menu options (including Force Quit in place of Quit).

  • Control/right-clicking the Dock’s divider brings up the Dock’s preferences menu.

  • Click-dragging the Dock’s divider line resizes the Dock smoothly.

  • Option-click-dragging the Dock’s divider line resizes the Dock in incremental steps.

  • Shift-click-dragging the Dock’s divider line allows you to quickly change the Dock’s position on the screen.

  • Command-clicking a Dock item reveals the item in the Finder.

  • Option-clicking an application in the Dock launches the application (or switches to it, if it’s already running) and hides the frontmost application. (Remember that the Finder is an application.) This also works when you option-click in a window in an application; you can quickly hide the frontmost application by option-clicking anywhere on the Desktop.

  • Command+option-clicking an application in the Dock launches or switches to the application and hides all other applications.

  • Command-dragging a Dock item out of the Dock (assuming you pressed the command key before you clicked on the item to drag it) allows you to work with that item’s icon just as if you were dragging it in the Finder.

  • Holding down command+option as you drag a document onto an application in the Dock forces that application to open the document (even if it’s not the application with which the document is normally associated).

  • Shift-clicking a minimized window in the Dock restores the window in slow motion (useless, but cool to watch nonetheless).

  • Pressing command+option+D toggles Dock auto-hiding on/off. This command can be useful if you normally show the Dock and an application’s windows overlap the top of it (Internet Explorer is guilty of doing this quite often); if you press this key combination twice, you’ll quickly hide and show the Dock, and Mac OS X will automatically resize the offending application’s windows so they don’t overlap. Note that if an application has its own shortcut that uses command+option+D, this keyboard shortcut won’t work; you’ll need to switch to another application, or the Finder, first.

The Dock’s Application Switcher

In addition to the keyboard-mouse actions I just listed, the Dock also provides a built-in keyboard- based application switcher, loosely based on Windows’ Alt-Tab functionality. (Even though it doesn’t appear to be part of the Dock, it really is Dock-related.) In OS X 10.3 or later, if you hold down the command key and then press the tab key, a translucent, horizontal display, showing the icons for all active applications, will appear on the screen (Figure 6.7). Each time you press the tab key, the next application icon to the right will be highlighted. When you let go of the tab key, OS X will immediately switch to whichever application is currently highlighted. This is a great way to quickly switch between active applications. (You can cycle through running applications in reverse order by pressing shift+command+tab or, after pressing command+tab once, by pressing command+~. You can also click any icon in the display using the mouse in order to switch to that application immediately. Once the application switch display appears, you can also use the arrow keys and the home and end keys to navigate between applications. If you have a mouse with a scroll wheel, you can even use the scroll wheel. In other words, there are a lot of ways to use it!)

Click To expand
Figure 6.7: Mac OS X’s application switching display
Tip

If you have a programmable mouse with a scroll wheel, set the scroll wheel “click” to emulate command+tab— you can then quickly switch between applications by pressing the scroll wheel to bring up the application switcher and then rotating the scroll wheel to select an application.

Even more convenient, OS X organizes the application icons in order of most recent use. That is, the current application is on the left, and the most recently used application is next, followed by the application used just prior to that one, and so on. An application you haven’t touched in hours will sit all the way to the right. Most of the time this arrangement is ideal because users tend to switch between recently used applications more often. In other words, you can quickly change to the last application you used by simply pressing command+tab once.

Note

In OS X 10.2 and earlier, you won’t see the on-screen display described above; instead, each active application’s Dock icon will be highlighted in succession. The most recently used application will be highlighted first, and then active applications will be highlighted from left to right (or top to bottom, if the Dock is at the side of the screen). The selection will wrap around once it gets to the end of the Dock. This behavior was much less useful in my opinion, which is why I found LiteSwitch, described in the next section, to be indispensable prior to OS X 10.3.

In addition to switching between applications, you can also perform other actions using the Dock’s keyboard switcher. As a particular application’s icon is highlighted, you can press the H key to hide that application or press the Q key to quit it. As long as you hold down the command key, you can cycle through all running applications, hiding or quitting them, until you settle on an application and release the command key to switch to it.

Tip

One of the very cool things about drag-and-drop in OS X is that it works with the application switcher—you can actually switch applications while you’re dragging a file or some data. For example, you can highlight and drag some text from an e-mail and, while still holding the mouse button down, press command+tab to switch to TextEdit. TextEdit will come forward, and you can then drop the dragged text into a TextEdit document window. (If a document isn’t open, you can even press command+N to open a new one while you’ve got your text floating around with your cursor!) This is a great way to drag data to an application that’s hidden behind other windows. (This feature also works with third- party keyboard application switchers, such as those mentioned in the next section.)

While I’m on the topic of controlling the Dock with the keyboard, I should point out that you can also access the Dock, including all Dock items and Dock menus, by enabling Full Keyboard Access in the Keyboard pane of System Preferences. When activated, pressing control+F3 activates the Dock; you can then use the left/right arrow keys to move between Dock items and the up/down arrow keys to scroll through Dock menus. Hit the return key to select any item.

Third-Party Keyboard Application Switchers

Mac OS X’s built-in application switcher is great, but it isn’t perfect. I prefer the third-party utility LiteSwitch X (http://www.proteron.com/liteswitchx/), which, if you’re using OS X 10.3 or later, works very much like the built-in application switcher—in fact, it includes all of the same features. However, it provides a few useful options not found in Mac OS X. You can choose the keyboard combination used to switch applications (either tab or return, combined with a modifier key such as command, option, or control). You can control/right-click an application icon in the display to perform a number of additional actions on it, such as Get Info, Show In Finder, Relaunch, or Force Quit. (You can also access any of these functions by pressing an appropriate key while the icon is selected in the window.) If you don’t want a particular application to appear in the display you can choose to exclude it. You can even drag files onto an application icon in the display to open them in that application, which is helpful if you choose to keep the Dock hidden. Finally, you can decide whether you want all windows in an application to be brought forward when you switch to it or just the frontmost window.

LiteSwitch also offers a number of customization options that make it much more flexible than OS X’s own application switcher. If you haven’t gotten the hint yet, I highly recommend it.


Accessorizing Your Dock

It’s clear from the discussion so far that the Dock provides much more functionality that it appears to at first glance. But another great thing about the Dock is that third-party developers have taken advantage of the Dock’s own features—Dock menus and “live” icons, for example—to provide much more functionality. The following are a few choice examples of ways to accessorize your Dock.

Not-So-Ugly Docklings

In early versions of Mac OS X, Apple provided small Dock-based applications called Docklings. These applications didn’t have any menus in the menu bar, and you couldn’t even switch to them— they existed only in the Dock, and all their functionality was provided via their Dock icon and menu. A few third-party developers figured out how Apple made Docklings work, and the concept of Docklings caught on. However, despite their popularity, Apple eventually decided to get rid of Docklings. Not only that, but they changed the way the Dock worked, so some older Docklings refused to work properly.

The good news is that starting with Mac OS X 10.1, many of the features that made Docklings so popular—such as custom Dock menus—were available to normal applications. So the same sorts of functionality that made Docklings so popular could be provided via standard applications. Today scores of Dockling-like applications are available for download.

Tip

Although most “real” Docklings no longer work properly, a few do. To test one, simply drag it to the Dock. Click or control/right-click the Dockling to see if it works. If it doesn’t, you may be able to use the freeware DocklingWrapper (http://homepage.mac.com/bwebster/docklings.html) to convert the Dockling into a standard application—after the conversion, launch it like any other application and access its Dock menu. Some older Docklings are available at http://www.eskimo.com/~pristine/dockling.html.

Because there’s not a lot of functionality to these Dock-based applications besides what they do in the Dock, the best way to give you an idea of what they can do is to show you. Figure 6.8 shows six different Dock-based applications. Left to right, they are:

  • Calindock (http://www.criticalmatter.com/calindock/ ): A live calendar.

  • Vanity Dockling (http://homepage.mac.com/bernardi/MacOSX.html ): A running tab of how long your Mac has been running since the last startup.

  • System Manager X (http://www3.nb.sympatico.ca/gamson/SystemManager/index.html ): A system monitoring utility; you can view any of its graphs in the Dock—this display is CPU usage.

  • EightBall (http://www.inferiis.com/products/eightball/): Ask it a question, click the icon, and it gives you the answer.

  • Prefling (http://homepage.mac.com/asagoo/prefling/index.html): Provides a menu for direct access to any preference pane. (A similar utility, Dockprefs, is available from http://ksuther.dyndns.org/software/dockprefs/.)

  • DocJector (http://www.monkeyfood.com/software/docJector/ ): Provides a menu of all mounted volumes. Select one from the menu, and it’s unmounted (and ejected, if applicable).

You’ll notice that the Dock icons are fairly large in this picture; some of these apps—those that actually try to display something like a calendar or a graph—almost require you to use Dock magnification.

Figure 6.8: Some Dock-based applications
Tip

The Clock application in Mac OS X 10.2 and earlier is another good example of a Dock application—in Clock preferences, select “Display in the Dock” and you’ll get a miniature clock icon that works in real time.

(Dock) Menus to the Max

I showed you earlier how a standard application (iTunes) could add custom items to its Dock menu to access features or to add functionality. Taken to the extreme, it follows that an application could conceivably provide all of its functionality through its Dock menu. In fact, a number of utilities do just that. A couple popular examples are the commercial DockExtender (http://www.codetek.com/php/dockext.php) and the freeware Yadal (http://orane.org.free.fr/ ).

For example, DockExtender lets you construct as many as 10 custom Dock menus that include applications, files, folders—anything you could access in the Finder—and lets you group items in sub-menus if desired. You can even assign a HotKey (keyboard shortcut) to each menu; pressing the HotKey opens the menu under your mouse, even if the cursor isn’t over the Dock. I keep my most frequently accessed folders and utilities in a DockExtender menu so I have quick access to them without littering the Dock. (Dock Extender also has another nice feature that I talk about in the next section.)

Double (and Triple) Docks

Some people like having lots of items in easy reach; I’ve seen Docks with 50 or 60 items in them! There are of course options besides the Dock (I’ll talk about a few in a moment), but some people just like the Dock, and dangnabbit, they want to use the Dock.

If you’re one of these people, one solution you might consider is multiple Docks. You’re probably thinking “Huh? How do I do that?” It’s actually not as big of a deal as you might think. When you customize your Dock, your choices are stored in a preferences file. You could save a copy of that file, then change the Dock around, then save another copy, then change the Dock around, and so on, until you have several different copies of Dock settings. You could then quit the Dock and swap preference files as it relaunches.

That’s the idea, at least, and luckily there aresome very handy utilities that do all the dirty work for you. DockExtender (mentioned in the previous section), DockFun! (http://www.dockfun.com/), and DockSwap (http://pidog.com/OSX/) all allow you to customize the Dock and then save your setup as a custom configuration. You can thus create numerous Dock configurations—for example, one with all of your Internet apps, one for graphics programs, one with games, etc.—and easily switch between them. These three utilities are so similar in this respect that the biggest difference is the switching method. DockExtender and DockSwap use their Dock menus whereas DockFun! offers both a Dock menu and a floating palette.

The DockFun! website provides a unique video showing the use of multiple Docks; if you’re interested in giving multiple Docks a try, it’s a great place to start.


Alternatives to the Stock Dock

Despite its functionality and ease of use, there are some common complaints heard about the Dock. I already mentioned one—it can’t hold a lot of items without becoming overcrowded—but there are others as well. Many of these complaints revolve around its inflexibility: You can’t move it to a second monitor, you’re locked into a single view, and so on—everyone seems to have a complaint or two about the Dock.

Part of the problem is that it’s really a jack-of-all-trades. It launches, it switches, it stores, it controls, it slices, it dices. Putting such diverse functionality in one place, and keeping it easy to use, means it isn’t going to be as comprehensive at anything as some people would like. With that in mind, here are some “alternatives” to the Dock. I use the word in quotes because nothing is going to do everything the Dock can do, and chances are you aren’t unhappy with everything about it. So instead of “replacing” it, I’m going to talk about third-party software that do Dock-type things exceptionally well.

I’ve divided this discussion into two groups of utilities: file access and launching utilities that are very different from the Dock and utilities that are Dock-like in their solutions.

Un-Dock-Like Alternatives

It seems hard to believe, but people managed to access files and applications just fine before the Dock came around, even when they didn’t want to browse through folders manually. Windows users have had the Start menu for years, and Mac users had the Apple Menu and utilities such as ACTION Menus and Now Menus, as well as keyboard launchers.

Some of these same types of solutions have become popular in OS X—menus and keyboard-based utilities are some of the most common methods for users to get to their files, folders, and applications.

Menus

If you’re the type who likes to access things through menus, there are plenty of menu-based utilities for accessing files, folders, and applications. I already mentioned one of the best, MaxMenus, in Chapter 5. Other excellent options are the shareware Snard (http://www.gideonsoftworks.com/snard.html) and the commercial You Control (http://www.yousoftware.com/products/control.php). Snard lets you construct a custom menu bar menu, via drag-and-drop, that includes applications, files, folders—anything you could access in the Finder—and lets you group them in sub-menus if desired. Snard also provides a feature called worksets that will open a list group of files all at once so you can get to work quickly. You Control also lets you create custom menu bar menus but lets you have as many as you like; you can even create menus that pop up under your mouse when you press a certain keyboard command.

However, MaxMenus is especially impressive in this capacity because it provides the ability to drag files onto application icons in menus and the ability to create menus that contain both frequently used applications and currently running applications. For example, I’ve created a menu that contains my favorite drag-and-drop applications and all currently running applications and assigned a keyboard combination to that menu. Whenever I have a file that I want to open in a certain application, I simply press the keys to activate the menu, and it pops up directly under the cursor. I then drop the file onto one of the application icons (see Figure 6.9). In addition, you can also act on menu items—if you have a menu that includes running applications, you can quit, relaunch, force quit, or switch to any of them using the mouse or keyboard. You can even grab an item in any MaxMenus menu and then drag it to the Finder, to the Dock, or to any other MaxMenus menu. Finally, you can assign a keyboard shortcut to any item in any MaxMenus menu by selecting the item and then pressing the key combination you want to assign to that item. The more I use MaxMenus, the more ways I use it.

Figure 6.9: Using MaxMenus to open an Acrobat document using Preview

Another great menu-oriented utility is piPop (http://www.pidog.com/pipop/). piPop works much like MaxMenus in that you can drag items onto menus. You can set your piPop menus to pop out from the side of the screen (like a hidden Dock) or to pop up anywhere on the screen using a key combination. In addition, you can "tear off" menus that then float above application and Finder windows. If you’re only concerned with opening applications, the freeware HimmelBar (http://softbend.free.fr/himmelbar/index.html) provides a useful menu bar menu that includes all applications, divided by their enclosing folder (Applications, Utilities, Developer, User, Network, or any other folder you choose).

Finally, one of the easiest menu utilities to use is the shareware AliasMenu (http://www.widemann.net/aliasmenu/index.html). Any folder or folder alias you place into the AliasMenu folder (~/Library/AliasMenu) will automatically become a new, hierarchical menu in the menu bar. For example, an alias of your Documents folder becomes a new Documents menu. By editing the names of items in the AliasMenu folder (as explained in the included documentation), you can create keyboard shortcuts for items, reorder items, and create groups of items that are opened all at once. If you place text clippings in an AliasMenu menu, selecting that clipping will actually paste it into the frontmost application. (Creating a clipping named Date will automatically paste the current date!) AliasMenu allows you to choose the number of hierarchical levels in your menus, icon size, and spacing, and you can even designate keyboard commands to get info about a menu item or reveal it in the finder instead of opening it.

Note

If you prefer to access files and applications from contextual menus or would like to have such a feature as an additional option, a number of utilities provide application launching and file browsing from contextual menus, such as FruitMenu (mentioned in previous chapters), Launch Items X (http://www.naratt.com/LaunchItems.html), and QuickAccessCM (http://free.abracode.com/cmworkshop/). In addition, as described earlier in this chapter, MaxMenus and piPop provide pop-up menus that can be accessed anytime, much like contextual menus.

Keyboard Launchers: LaunchBar

I’m one of those people who just don’t like taking their hands off the keyboard—it generally interrupts the flow of whatever I’m doing. In fact, the first thing I do when I start playing around with a new piece of software is to check out the keyboard shortcuts listed in the menus. I set up hotkeys to launch applications, and, using a utility such as Keyboard Maestro, QuicKeys, or Key Xing (all discussed in the Online Supplement to Chapter 5), I automate some of the things I do most frequently. The only problem with this approach is that it requires me to remember an insane number of cryptic keyboard combinations—and every once in a while I press the wrong one and very bad things happen. If you’re like me—heck, if you’re even remotely like me—being able to launch applications and access files from the keyboard without having to remember myriad different key combination would be like taking another step up the evolutionary ladder. OK, maybe not that big of a deal, but it would be pretty cool nonetheless.

So when I discovered LaunchBar (http://www.obdev.at/products/launchbar/ ), I was floored. Here was the utility I’d been waiting for; I paid for it five minutes after I downloaded it. It was that good. The problem is that it’s one of those things you can’t explain very well—you have to use it to "get" it.

Put simply, you press a key combination (the default is command+space), and LaunchBar’s small, well, “bar” appears (Figure 6.10). Type the first few letters of the object you’re trying to access—an application, a document, an e-mail address, a URL—or even the item’s “initials,” and LaunchBar makes its best guess as to what you’re looking for and presents a menu with its guesses. The more letters you type, the better the guess it makes, and the shorter the menu. When you’ve found the right item, press return to launch/open it (or press command+return to show it in the Finder).

Click To expand
Figure 6.10: LaunchBar (left) and LaunchBar’s results listing (right) after typing net on my computer

But what makes LaunchBar so incredible is that it learns. If you want it to select Photoshop whenever you type PS, you just type PS and manually select Photoshop from the list of possible matches. The next time you type in PS, will list possible matches, but Photoshop will be selected by default. And so it goes, with every use, until after a short while it gets exactly what you want with only a couple of letters, no matter what those letters are. For example, my LaunchBar knows that IE means Internet Explorer and that XL stands for Microsoft Excel. You can even access System Preferences panes directly.

In addition, if you use the arrow keys instead of typing letters, LaunchBar lets you browse mounted volumes; when you get to the item you want, you can open it, show it in the Finder, copy its file path, or perform any of a number of other actions. You can even grab an item from LaunchBar and drag it to the Finder, the Dock, or anywhere else, or you can drag an item from the Finder onto LaunchBar, type a few letters to get the appropriate application, and then drop the item onto its name in the LaunchBar window. As an added bonus, when you activate LaunchBar (via command+space), if you hit the spacebar again or press command+R, LaunchBar becomes an application switcher.

The beauty of LaunchBar is in its simplicity; however, it’s also quite powerful and configurable, far beyond what I have space to go into here. All I can say is that LaunchBar is, in my opinion, a utility everyone should at least try. I’m the first to admit that I’m at the extreme end of the keyboard-loving spectrum, and I realize that most users like a little mouse action now and then. But the truth is that sometimes using the keyboard is just faster and more convenient, and every person I’ve shown LaunchBar to has become a convert. In fact, the only applications I keep in my Dock nowadays are those I tend to launch by drag-and-drop with documents. Everything else I launch via LaunchBar.

Dock-Like Alternatives

What if you really dislike the Dock? To some extent you’re out of luck because the Dock is there, and you can’t really do much about that (see the next note box). However, you can certainly hide the Dock and use one of several popular Dock-like alternatives.

The most popular Dock replacement is surely DragThing (http://www.dragthing.com/ ), which was around as a Classic Mac OS utility years before Mac OS X was released. Another long-standing favorite is DragStrip (http://www.aladdinsys.com/mac/dragstrip/index.html). However, some impressive challengers have been released over the past couple years, including WorkStrip X (http://www.softchaos.com/ ), and Dock-It (http://www.gideonsoftworks.com/ ). Each takes a different approach, and just describing the visual (Figure 6.11) and interactive differences between them would take up a chapter in and of itself. Suffice it to say that they each provide multiple "Docks" or workspaces, each takes advantage of drag-and-drop, and each does things the Dock can’t touch. Overall, I would say that DragThing is the most extendable and has the most options, Dock-It is unique in that you can have multiple Docks on the screen at the same time, and WorkStrip X has the advantage of keeping track of recent projects and documents to make switching between them and accessing them easy.

Note

Under older versions of Mac OS X, if you really didn’t like the Dock, you could disable it or even replace it with a third-party utility. However, under OS X 10.2 and later, Apple made some changes that make disabling it much less appealing—for example, disabling the Dock also disables the keyboard application switcher and, in OS X 10.3, disables Exposé. If you’re determined to disable the Dock, you can either command-drag the Dock application out of /System/Library/CoreServices (which will require you to authenticate) or use a utility such as DockBlock (http://sideburn.com/dockblock/ ) to toggle it on and off. However, I instead recommend this alternative: Remove everything from the Dock, reduce it to its smallest size in the Dock preferences, place it on the side of the screen you frequent the least, and enable hiding. It shouldn’t bother you much that way, all the other Dock-related features will still work, and you can feel free to use whatever alternative you like.

Click To expand
Figure 6.11: Some Dock alternatives: DragThing (top) and WorkStrip X (bottom)

The truth is it’s really not possible to completely replace the Dock, especially not with a single utility. Just the fact that the Dock allows you to minimize windows (other utilities can’t) gives it at least one advantage. Plus, the Dock lets you instantly access any window in any application (including the Finder), which at the time of this writing isn’t possible via any other software. Finally, all those cool features such as Dock menus and “live” Dock icons I’ve talked about in this chapter are only available through the Dock. Lose the Dock and you lose all that functionality.

That being said, there are a lot of good reasons you might want to use one of the utilities mentioned in this section. Being comfortable and happy with your computer is as much about personal preference as anything else, so if you’re in the market for a Dock-like alternative (or even just a supplement), don’t let my (too) brief comments on each make up your mind. I encourage you to down- load the demo versions of each and try them. If something other than the Dock makes your computer life better, more power to it, and to you.


Moving On...

Team LiB

Moving On…

By now I’ve covered pretty much everything you need to know to get your computer up and running (the way you want it), and you’re well on your way to becoming a master at working with files, folders, and the Dock. Now you can finally move on to what you bought a computer for in the first place— running applications.


Chapter 7: Application Aptitude

(Or: Using Apple’s applications, and applications in general.)

Overview

Mac OS X comes with all the applications you need to perform most general tasks—e-mail, word processing, DVD watching, listening to music—right out of the box. I proposed in the previous chapters that the Finder and Dock are the centers of activity on your Mac, but you probably spend most of your time actually using applications. (After all, you didn’t buy a Mac to move files back and forth all day, right?)

In this chapter, I’ll provide you with some great tips for using applications in general. I’ll also cover a few techniques for dealing with problematic applications, and talk about some ways to better work with text in Mac OS X. However I’ll spend most of this chapter covering the many applications and utilities that come with Mac OS X—specifically, all the “lesser” applications you don’t hear about. (You may not even be aware that some of them exist!) I’ll also include some tips for working with text in OS X.

Note

In most chapters I include the tip table for every section; however, since most application settings are user-level preferences, unless otherwise noted the tips in this chapter can be performed by any user and affect only that user.


Applications 101

Regardless of whether an application is a word processor or a disk utility, and whether it came with Mac OS X or you installed it yourself, chances are it behaves in certain ways common to all Mac OS X applications. You launch it by double-clicking its icon in the Finder or by clicking its icon in the Dock; it has an application menu on the left side of the menu bar; and you quit it by choosing Application Name Ø Quit (or by pressing command+Q). There are lots of other ways in which OS X applications behave similarly; here are a few tips to help you better use applications in general.

Hiding and Minimizing Applications and Windows

This is a bit of a rehash of information I mentioned in previous chapters, but I repeat it here in the interest of thoroughness. You can hide the frontmost application completely by choosing Application name Ø Hide application name, by pressing command+H, or by choosing the Hide item in the application’s Dock menu. (In fact, you can use the latter method to hide applications that are in the background.) You can “unhide” an application by clicking its icon in the Dock or, if you want to unhide all applications at once, by choosing Application name Ø Show All.

If you just want to “hide” individual windows, rather than entire applications, you can minimize any window to the Dock by clicking the yellow minimize button in the upper-left corner (or by pressing command+M to minimize the active window, assuming the developer follows Apple’s application guidelines). You can minimize all windows in a particular application by holding the option button down as you minimize any window belonging to that application.

However, if you’re hiding windows just to make it easier to access particular windows or files, an alternative is OS X’s Exposé functionality, described in the next section.

Exposé: Accessing Windows (and the Desktop) Easily

One major advantage modern operating systems (such as Mac OS X) have over their predecessors is that you can use a number of applications simultaneously—I often have 20 or more running at once! However, this capability comes with baggage of its own: dealing with the myriad windows cluttering your screen. After all, if you have 10–20 windows open, it’s not always easy to find the one you want and to find it quickly. (Not to mention how difficult having so many windows open makes accessing the Desktop.)

With Mac OS X 10.3, Apple introduced a new (and in many ways revolutionary) feature that attempts to fix these problems for good: Exposé. As its name implies, Exposé exposes application windows—by temporarily moving them around and resizing them—so that every window in every application is instantly accessible. However, because you aren’t always trying to find the same thing, Exposé provides three different modes: all windows mode, application windows mode, and Desktop mode. Each mode can be activated in several different ways. (See “The Exposé Pane of System Preferences” for how to choose your preferred activation actions.)

Note

Remember that the Finder is an application; as such, its windows behave just like other application windows when you use Exposé.

To get a better understanding of each of the three Exposé modes, here are more detailed descriptions of each:

All windows mode When you activate the all windows mode of Exposé—by default, by pressing F9—Mac OS X tiles all open windows, for all applications, across the screen, shrinking them as needed (Figure 7.1). When you find the window to which you want to switch, simply click it with the mouse cursor—all windows will be restored to their normal sizes, but the selected window will be brought to the front. (If you don’t recognize a particular window by its minimized appearance, move the cursor over it; the window will be highlighted using the Highlight Color in Appearance preferences, and the window’s name will appear in a small overlay, as shown by the Safari window in the upper left of Figure 7.1.)

Click To expand
Figure 7.1: The all windows mode of Exposé

Application windows mode Application windows mode—activated, by default, by pressing F10—is similar to all windows mode, but instead of presenting all application windows across the screen, it “exposes” only the windows of the current (active) application (Figure 7.2). Windows in other applications remain at their normal size but are grayed out and sent to the background. Just as with all windows mode, moving the cursor over a window identifies it, and clicking a window brings it to the front.

Click To expand
Figure 7.2: The application windows mode of Exposé

Desktop mode Desktop mode—activated, by default, by pressing F11—functions a bit differently than the other two modes; it’s designed to solve the age-old problem of how to access files on the Desktop that are buried beneath window clutter. When you activate Desktop mode, all windows, including Finder windows, application windows, and palettes, gracefully slide off the edges of the screen, providing you with an unobstructed view of the Desktop (Figure 7.3). You can select (and open) items on the Desktop, move Desktop items around, and even open (and work in) new Finder windows while all of your previous windows are hidden. Pressing F11 again, or clicking an application icon in the Dock, restores all windows to their original positions.

Click To expand
Figure 7.3: The Desktop mode of Exposé
Tip

Exposé provides very cool functionality, but its “eye candy” is just as impressive. The first time you use it, you’ll probably activate it over and over, just to see it in action. If you’re nodding your head in agreement right now, try holding the shift key down as you activate or deactivate Exposé, or as you choose an Exposé-minimized window—the slow-motion effect is way cool.

Note

Unfortunately, Exposé doesn’t support Classic applications. Classic applications simply “disappear” when Exposé is activated.

The Exposé Pane of System Preferences

User Level | any
Affects | individual users
Terminal | no

As I mentioned above, you activate the three modes of Exposé, by default, using the F9, F10, and F11 keys. However, by using the Exposé pane of System Preferences (Figure 7.4), you can choose the specific actions—screen “hot corners,” keyboard shortcuts, or specific mouse buttons—to associate with each mode.

Figure 7.4: The Exposé pane of System Preferences

The Active Screen Corners section of Exposé preferences lets you use the corners of your screen to activate the various Exposé modes. If this dialog looks similar to the Hot Corners dialog for Mac OS X’s screen saver, discussed in Chapter 2, that’s because it’s the same dialog, just integrated into the Exposé pane. (In fact, you can access the screen saver Hot Corner options here, as well.) To assign an Exposé mode to a screen corner, click the pop-up menu next to that corner, and then choose the desired mode. When a corner is assigned to an Exposé mode, moving the cursor into that corner will activate Exposé, just as if you’d pressed the appropriate F-key. To deactivate Exposé, either click anywhere on an “exposed” window or move the cursor into the Hot Corner again. (The caveats about Hot Corners I mentioned in Chapter 2 apply here, as well.)

The Keyboard section lets you assign each Exposé mode to a particular key. The options available are the F1 through F13 keys, as well as the left-hand shift, control, option, and command keys. In addition, if you press the shift, control, option, or command keys—or any combination of these keys—while one of the mode pop-up menus is open, you can assign additional key combinations to modes. For example, if you hold down the command and option keys and then select F12 from the Desktop mode pop-up menu, you assign command+option+F12 as the keyboard command for Desktop mode. To activate an Exposé mode, simply press the assigned key or key combination; pressing it again (or clicking a window) deactivates the mode and restores windows to their original positions.

Finally, if you have a multi-button mouse, the Mouse section lets you assign one or more Exposé modes to buttons on your mouse. Depending on your mouse, the available options will be Right Mouse Button, Mouse Button 2, Mouse Button 3, and so on—Mac OS X usually recognizes the number of buttons on your mouse automatically. For example, my Logitech MX 900 mouse has eight buttons, all but one of which are available for use in activating the various Exposé modes. (The “left mouse button” won’t show up as an option, since you always have to have one button act as a standard mouse click.) Like the Keyboard section, if you press any combination of the shift, control, option, and command keys while one of the mode pop-up menus is open, you can assign a keyboard/mouse combination to a mode (e.g., shift+right-click). Pressing a mouse button (or combination) assigned to an Exposé mode activates that mode. To deactivate Exposé, either press the assigned button again or click a window to select it.

Tip

If you have a mouse with a scroll wheel, one of the button identifiers in the Mouse section will usually correspond to the scroll wheel “button.” By selecting this button for a particular Exposé mode, you can activate that mode by clicking the scroll wheel on your mouse.

Unfortunately, apart from Right Mouse Button, the button identifiers are pretty vague (e.g., Mouse Button 4). Even more confusing, they differ from mouse to mouse— “Mouse Button 3” may be the scroll wheel on one model, whereas on another it may be a button on the side. You’ll have to experiment with the settings to figure out which “Mouse Button” identifier corresponds to which button on your mouse. (Note that some third-party mouse drivers will interfere with Exposé’s mouse functionality; if this happens to you, the “solution” is to either uninstall your third-party drivers or simply use one of the other methods for activating Exposé.)

Finally, you’ll notice that every pop-up menu in Exposé preferences contains the – item. This item in a menu basically disables the feature chosen using that menu. In other words, if you had previously enabled a keyboard shortcut for Exposé’s Desktop mode, choosing – from the Desktop pop-up would remove that shortcut.

Tip

You can assign multiple “activation actions” to each Exposé mode and use them concurrently—for example, you can assign a Hot Corner, a keyboard command, and a mouse button to activate Desktop mode. In addition, you can deactivate Exposé using a different command than the one used to activate it—for example, you can activate Exposé using a mouse button and then deactivate it using the keyboard. Exposé gives you a great deal of flexibility in this regard.

Note

Although you can assign only a single keyboard shortcut and a single mouse button to each Exposé mode, you can assign a mode multiple hot corners. The only caveat, of course, is that you have only four corners available to you, and they’re shared between three Exposé modes and two screen saver actions (Start Screen Saver and Disable Screen Saver). So if you assign all four hot corners to Exposé’s Desktop mode, you won’t be able to use those corners for any other actions.

Using Exposé: Advanced Tips and Tricks

Although the descriptions in the previous sections explain Exposé’s basic functionality pretty thor- oughly, it’s even more flexible and powerful than it initially appears. Below are some of my favorite tips for taking better advantage of Exposé.

  • In application windows mode, you can use the tab key (and ~ or shift+tab) to cycle through applications. This is similar to using command+tab to access the Dock’s application switcher (as described in Chapter 6); however, instead of showing you an onscreen display of application icons, Exposé will change its focus from one application to the next—bringing all the windows for one application to the front and graying out the others. When the desired application is highlighted, press return or the space bar to select it.

    Note

    If you press tab or shift+tab when in all windows mode, Exposé will switch to application windows mode and then allow you to cycle through applications.

  • When application windows mode is active, you can use the up/down/left/right arrow keys to cycle between windows in the current application. Once you’ve highlighted the desired window, press return or the space bar (or deactivate Exposé) to select it. (Alternatively, when in all windows mode, you can use the arrow keys to cycle between all windows in all applications; however, this can get messy if you have a lot of applications open. See the next tip for a better solution.)

  • You can use the previous two tips together to easily select a particular window in a particular application. First, activate application windows mode and press tab, shift+tab, or ~ to highlight the desired application. Then use the arrow keys to highlight the desired window in that application. Press return or spacebar (or deactivate Exposé) to select that window.

  • If you hold down an Exposé mode’s keyboard command or mouse button instead of quickly pressing it, the mode will remain active until you release the key(s)/button, at which point Exposé will deactivate. For example, if you just want to quickly view an item on the Desktop, press F11 (assuming the default Exposé settings) and hold it down—this will reveal the Desk- top. Release F11 and all windows will be restored. (In fact, in all windows or application windows mode, if you move the mouse cursor over a window to highlight it while Exposé is activated, when you deactivate Exposé that window will be selected—you don’t even have to click the window! This is a great way to use Exposé with a multi-button mouse: Press and hold the Exposé mouse button, move the cursor over the desired window, and then release the button.) Note that if you assign an Exposé mode to F12, holding that key down on some newer Macs will eject the optical drive, as well.

  • In Chapter 6, I explained how you could drag files and/or content between applications using the Dock’s application switcher. You can do the same using Exposé—it fully supports drag- and-drop. For example, say you wanted to take some text from a Web page in Safari and place that text in a document you’re writing in Microsoft Word; to do this using Exposé, follow these steps:

    1. Select the text in Safari, and then start to drag it.

    2. Activate Exposé’s all windows mode to view all windows.

    3. Drag the text onto the “exposed” window of your Microsoft Word document; this should highlight the document’s window.

    4. Deactivate Exposé (by using the keyboard/mouse command, by pressing the return key or spacebar—which selects the highlighted window—or by simply holding the item over the highlighted window for a few seconds, which will automatically select it).

    5. Drop the text to the appropriate location in the Word document.

    This seems like a lot of steps, but it appears that way only because I wanted to explain the steps clearly. Once you’ve tried this technique once or twice, you’ll see how easy (and convenient!) it can be.

  • Similar to the previous tip, since the Finder is an application, you can also use Exposé to move files to and between Finder windows. Grab a file or folder (or drag content from a document) and then activate Exposé; you can drag the item into any Finder window. In fact, spring-loaded folders work in conjunction with Exposé, so it’s possible to drag the item to any folder anywhere on your hard drive!

  • You can use Desktop mode to quickly place a file or folder, or content from an application, on the Desktop. Start to drag the item, and then activate Desktop mode; drop the item onto the Desktop and then deactivate Exposé to return to where you were previously working.

  • Conversely, if you want to take a file located on the Desktop and use it in a different application, activate Desktop mode, start to drag the item, and then deactivate Exposé while still dragging the item; you can then drop the item into the current application. You can even grab an item off the Desktop while in Desktop mode and then immediately activate all windows mode to drop that item into any window in any application.

Enabling the Exposé “Floater” and Alternative Desktop Mode

In addition to the Exposé functionality Apple has made available, there are a couple hidden Exposé features they haven’t (yet?). The first feature is the Exposé “floater.” (It doesn’t have an official name, but the most popular names for it seem to be “floater” and “blob.”) The floater is simply a little Aqua, well, blob that, well, floats. More descriptively, it floats above other applications and acts as a button to activate/deactivate Exposé’s application windows mode (Figure 7.5). If you hold down the option key as you click the floater, it activates all windows mode instead. You can enable the floater using the free utilities The Blob (http://www.crabbyapplesoftware.com/) or Hackposé (http://www.ifthensoft.com/); TransparentDock, mentioned in Chapter 6, can also enable it. If you don’t like using keyboard commands, hot corners, or mouse buttons to activate Exposé, you may find the floater useful.

The second feature, which can be enabled by Hackposé, is an alternate Desktop mode. When this feature is enabled and you activate Desktop mode, all windows remain “onscreen,” unlike the standard Desktop mode; however, the entire screen (except for the Desktop itself, of course) shrinks down to a miniature version (Figure 7.5). This alternate mode doesn’t really add any functionality; it’s just a different visual effect. But isn’t it great to have choices?

Click To expand
Figure 7.5: The alternate Desktop mode (in the lower left corner) and the Exposé “floater” (lower right)

Windowing Wiles

In older versions of the Mac OS, clicking on or in any application window brought every window in that application forward. However, in Mac OS X, clicking on or in an application window (including Finder windows) brings only that particular window to the front. If you want to bring all windows of a particular application to the front, just click the application’s icon in the Dock. Alternatively, if the application is the active/frontmost application, you can use Exposé’s application windows mode to bring all of the application’s windows to the front—just quickly activate and then deactivate application windows mode.

If you prefer the “classic” window behavior of Mac OS 9 and earlier, where clicking any application window brings all windows in that application to the front, see the Online Appendix for a few ways to bring that behavior to Mac OS X.

Tip

I discussed OS X’s built-in keyboard application switcher in Chapter 6. As a reminder, one of its features is the ability to cycle through windows in the active/frontmost application by pressing command+~ (or shift+command+~ to cycle in reverse order).

Customizing the Toolbar

I’ve covered customizing the toolbar in my discussions of several applications, including System Preferences and the Finder. However, most Cocoa applications, and some Carbon ones, also include this functionality (see the sidebar “The Three C’s of OS X Applications”). You can usually access this feature by choosing View Ø Customize Toolbar… In addition, you can change the toolbar view by clicking or command-clicking the toolbar widget/button in the upper-right corner of any application window.

Using the Title Bar (Proxy) Icon

In Chapter 5, I discussed the title bar icon for Finder windows—the small icon next to a window’s title—and how it can be used as a “proxy” for the folder being viewed. However, you can also use the title bar icon in a document window as a proxy for that particular document. In fact, doing so works almost identically to the functionality I described in Chapter 5: Click and hold the mouse on the icon until the icon is “selected.” You can then drag the icon to the Desktop, to a folder or volume, or even to another application—just as if you were dragging the document’s icon in the Finder.

Start Sidebar
The Three C’s of OS X Applications

When reading about Mac OS X, you may come across references to “Cocoa,” “Carbon,” and “Classic” applications. These are names for three different kinds of applications that work in Mac OS X.

Cocoa Cocoa applications are written entirely using Mac OS X–native programming tools (the Cocoa environment for you techies out there). They run only in Mac OS X and are able to take advantage of all the cool Mac OS X tricks such as Services, font panels, toolbars, and spell-checking. (I’ll talk more about spell-checking, fonts, and Services later in this chapter.) TextEdit, Mail, and Stickies are examples of Cocoa applications.

Carbon Carbon applications are written for OS X’s Carbon environment and compose the majority of Mac OS X applications at the time of this writing. The Carbon programming environment has actually been around for quite a while—Mac OS 8 and 9 could run many Carbon applications. In fact, this is one of the main reasons Carbon applications are so popular: Many longtime developers who were familiar with writing Carbon applications for the Classic Mac OS can develop software for Mac OS X without much retraining. In addition, it’s relatively easy for developers to take applications written for Mac OS 9 and Carbonize them—that is, to adapt them so that they work in Mac OS X. Thus, many applications that existed for Mac OS 9 have been Carbonized and now work in both operating systems.When writing applications in Carbon, or Carbonizing existing apps, developers can choose how much of the Mac OS X (Aqua) interface to include; for this reason, some Carbon applications look very much like Mac OS 9 applications while others are, visually and functionally, almost indistinguishable from Cocoa apps. (Except that only Cocoa apps can take advantage of Cocoa-only features such as the Fonts panel).

Classic Classic applications are those applications written for Mac OS 9 or earlier that have not been Carbonized for use in Mac OS X. In order to run these applications, Mac OS X includes what’s called the Classic environment, which is basically a Mac OS X application that loads a copy of Mac OS 9, inside which the Classic applications run. I talk about the Classic environment and using Classic applications in Chapter 8.

Mac OS X also supports Java applications, and in fact Apple has provided the ability for developers to use the Mac OS X (Aqua) interface when writing Java apps. The advantage of Java applications is that they can theoretically run on any platform that supports Java (Windows, Mac OS X, Unix, etc.). However, at the time of this writing Java applications are rare.

End Sidebar
Note

If a document has unsaved changes, you won’t be able to select its title bar icon—you wouldn’t want to move a document with unsaved changes, or open it in another application. In order to take advantage of title bar icon functionality, save any changes first.

When you drag a document’s title bar icon to the Finder, exactly what will happen isn’t consistent, as different developers have decided to do different things by default. However, you can discern what will happen by the visual cues OS X provides: A standard cursor symbol means the actual document will be moved; a cursor with a green plus sign (+) means the document will be copied; and a curved arrow cursor means an alias to the document will be created. (Just like in the Finder, you can modify the default behavior by pressing option or command+option while dragging the icon. I frequently use the “make alias” procedure—command+option-drag—to create, on the Desktop, an alias to a document I’m working on.)

Tip

When dragging a document’s title bar icon, you can even take advantage of spring-loaded folders (discussed in Chapter 5) to place the document, or an alias to it or copy of it, several levels deep in a folder hierarchy.

If you drag a document’s title bar icon from a window in one application to another application, the file will be opened in the target application (if possible). However, although this is a neat feature, you should be careful when using it, as working on a document in two different applications is asking for trouble. It’s mainly useful for quickly viewing a document in a different application; for example, I often use this procedure to take an HTML page I’m editing in a text editor and then view it in Safari.

Tip

As in the Finder, you can also command-click a document’s title bar icon to see that document’s exact location on your computer; selecting a volume or folder from the resulting pop-up menu opens that directory in the Finder.

Getting and Using Help

One of the most underappreciated and underutilized features of Mac OS X is its built-in help system. Available via Help Viewer—which can be launched from the Help menu in any application—this system provides lots of info on OS X itself, as well as information and assistance for individual applications if application developers have provided it.

There are three ways to use Help Viewer. The first is to search all installed Help modules. Simply enter a word or words in the search field relating to the topic for which you need assistance, and then press the return key; Help Viewer returns a list of topics, ranked by relevance (how well each item matches your search). By clicking the column headings in the results window, you can also sort the search results by relevance (the default), alphabetically, or (sometimes most usefully) by the Help module each came from. The latter is helpful for finding which results pertain to the specific application you’re using.

Tip

If you’re a former Windows user, type glossary in the Help Viewer search field. The top result will be Windows to Mac Glossary, which lists key Windows terms and their corresponding Mac OS X terms. (This list can also be useful to Mac users who aren’t familiar with Windows.)

Tip

Advanced Help Viewer search techniques: When performing a search in Help Viewer, typing a + between words will find only Help pages that contain all those words ("and"). Inserting a | between words will find pages that contain any of those words ("or"). Typing ! before a word excludes from the search results any pages that include that word ("not"). If you want to group words, use parentheses. For example, typing (window|menu) + application ! Finder will find any page that includes application along with window or menu but does not contain Finder.

The second way to use Help Viewer is to search within a particular module. From HelpViewer’s Library menu, choose the Help module for a specific application, and then use the search field to search within that module. (In OS X 10.2, you instead click the Help Center button in the toolbar to view a drawer of installed Help Center modules and then click the relevant Help module.) Note that for some reason, some modules don’t seem to support module-specific searches—you get the same result as if you hadn’t selected any module.

The third way to use Help Viewer is to follow along with any built-in guides or tutorials the developers of an application (or the OS) have provided in their Help modules. Select the appropriate help module using the procedure described in the previous paragraph, but instead of performing a search, use the links presented on the module’s main help page. Help Viewer will walk you through the Help system for that particular module. This is an excellent way to learn tips and tricks for an application; for example, both iTunes and iPhoto have extensive Help modules with lots of tips and tricks.

At any time, using any of these techniques, you can use the Back button to go back to the previous screen(s) and the Forward button to go forward and retrace your steps. The Go menu also provides a list of recently accessed modules, as well as the results of the most recent searches you’ve performed.

Tip

If you find that the Help Viewer text is often too small, you’ll appreciate the Bigger toolbar item, accessible by customizing the toolbar.

Exploring Menus and Preferences

This is a short tip, but an important one. One of the best ways to learn what an application can do, but one that many users never take full advantage of, is to explore the functions available from its menus and preference dialog(s). You’ll often find features you didn’t know existed, or you’ll realize that features you’ve been wanting are right there under your mouse.


Getting the Most from Mac OS X's Applications and Utilities

Team LiB

Getting the Most from Mac OS X’s Applications and Utilities

As I mentioned earlier, Mac OS X comes with an impressive number of applications and utilities. Some of them you probably know well and use on a regular basis; others may be sitting on your hard drive unbeknownst to you. I’m going to talk about many of these programs, especially the gems that most people don’t use but should.

Note

Some of the OS X applications you’re probably most familiar with are the “iApps” (iTunes, iPhoto, etc.), Mail, and Address Book. These are probably the most well-known and widely used OS X applications, and as such they have entire books, websites, and mailing lists dedicated to them. Meanwhile, your Mac is full of other useful applications and utilities that rarely get mentioned. It’s the latter group of applications I’m going to spend time on here. However, even though I don’t talk about the iApps, Mail, and Address Book here, I’ve placed some good tips for them, as well as a few recommendations for great resources of information about them, on the book’s website, http://www.macosxpowertools.com/.

To give this discussion some semblance of organization, I’ve split the built-in applications into two groups: “applications” (Apple-provided software—besides the iApps—located in /Applications) and "utilities" (Apple-provided software that resides in /Applications/Utilities). The sheer number of applications and utilities (and the fact that some of them are quite simple in what they do or how they work) means that I’ll gloss over a few; rest assured that if I don’t give a particular application its fair shake, it’s probably because you can easily figure it out on your own or because I talk about it elsewhere in the book.

Mac OS X’s Applications

The “applications” discussed here are those installed with Mac OS X—or downloadable from Apple—and located in /Applications (in other words, not in the Utilities folder). In a few cases, an application will have its own subfolder; I’ve noted where that’s the case.

Backup

The Backup application isn’t actually installed by Mac OS X; it’s available only to members of Apple’s .Mac service. (If you’re a member, you can download Backup by browsing to http://www.mac.com/ and going to the .Mac Downloads area.) Backup allows you to back up files, folders, or volumes to your iDisk or to removable media such as CD-R or DVD-R. I’ll talk more about using Backup and other backup utilities in Chapter 14.

Calculator

The Mac OS has always included a basic calculator application, but Mac OS X provides a much improved, and much more capable, version. You can choose the level of precision of your results using the View Ø Precision submenu, and you can even choose the display format—decimal, hexidecimal, binary, etc. In addition to the functions you find on your average calculator, it provides three other significant features.

Advanced functions By choosing View Ø Advanced, the Calculator application expands to a full-featured scientific calculator, replete with trigonometric and log functions, exponentials, and memory registers. (If only it provided an option for RPN entry…)

“Paper” tape Choose View Ø Paper Tape and a, well, ”paper tape” window appears that displays a record of any calculations you’ve performed using Calculator. (In OS X 10.2, it’s a drawer rather than a separate window.) You can copy any part of the tape for pasting into another application; save the entire tape to a text file by choosing File Ø Save Tape As…; and even print the tape via File Ø Print Tape….

Tip

If you delete a number in the “paper tape” display and then type a new number in its place, clicking the Recalculate Total button does just that—it finds the new result, using the new number as part of the calculation in place of the original.

Conversions Probably the coolest feature of Mac OS X’s Calculator is its conversion functionality. Type in an amount (area, length, weight, temperature, power, etc.), and then choose the type of conversion you want to perform from the Convert menu. Calculator gives you a window to choose the unit of measurement you’re converting from and the measure you’re converting to, and then it does the conversion for you. It will even convert currency using the latest currency exchange rates. (Choose Convert Ø Update Currency Exchange Rates to make sure you have the most recent rates.)

Tip

In OS X 10.2, clicking the zoom button (the green one in the upper left) reduces the Calculator to just the display; you can still control it using the keyboard, but you won’t see the Calculator body on the screen. (In fact, if you’re an awesome touch-typist, you can have Calculator read any total to you by choosing Speech Ø Speak Total—you’ll never even have to look at the Calculator application. This latter feature works in OS X 10.3 and later, as well.)

Accessing Hidden Calculator Features

Under OS X 10.3, Calculator also has a few hidden features, but it requires a bit of work to reveal them.

  1. Quit the Calculator application if it’s currently running.

  2. Select the Calculator application in the Finder, and then choose File Ø Get Info… In the resulting Info window, expand the Plug-ins panel. You’ll see a single plug-in called BasicAndSci.calcview.

  3. Click the Add… button; in the resulting dialog, navigate to /Applications/Calculator/Contents/Resources.

  4. Inside the Resources folder, you’ll find three folders: ExpressionSheet.calcview, Graphing-2D.calcview, and Hexadecimal.calcview. Command-click each of them (to select them all), and then click Open.

The three plug-ins will now be listed in the Plug-ins panel. From this point on, when you launch Calculator, its View menu will contain three new options: Expression Sheet, Graphing, and Hexidecimal. The first lets you type in an advanced mathematical expression and then have it evaluated. The second lets you type in an expression and then view a two-dimensional graph of that expression. The third provides an impressive hexidecimal calculator, including Boolean operations.

Tip

By using the Finder’s Show Package Contents command, if you navigate to /Applications/Calculator.app/Contents/Resources/ ExpressionSheet.calcview/Contents/Resources/English.lproj, you’ll find a text file called ExpressionSyntax.rtf that documents the syntax required by the Expression Sheet view.

Chess

The Chess game lets you play against the computer, play against another person, or just watch the computer play itself (good for learning the game). If you play against the computer, in OS X 10.3 you can choose (from the preferences dialog) whether the computer plays faster or better (“stronger”); in OS X 10.2, the choice is instead how difficult the computer is to beat. You can view the board as a two-dimensional board, but using the three-dimensional setting shows off your Mac’s graphics a lot better.

Chess also offers some nice extras. You can save your game in progress to finish it later. You can use Speech Recognition to play the game hands-free (e.g., “Knight b1 to c3”). You can even view a log of all moves in the current game and export that log for future reference. Finally, if you’re stuck, you can choose Move Ø Hint to get a hint.

Tip

If you want to disable the speech feedback window, choose Chess Ø Preferences and then uncheck the “Allow Player to Speak Moves” option (“Use Speech Recognition” in OS X 10.2).

Clock

The Clock application is installed only with OS X 10.2 or earlier; Apple has removed it in OS X 10.3. (If you’re using OS X 10.3, you can still use it by simply copying it from a Mac running OS X 10.2 or by extracting it from the OS X 10.2 Install CDs as described in Chapter 4.) It’s one of those applications that don’t get used much because of Mac OS X’s built-in menu bar clock—many users figure that since they’ve already got a clock in the menu bar, why waste screen space with a floating clock? Here’s a tip—with the proliferation of application menus and menu bar items, most of us could use a little bit of extra menu bar space. Turn off the menu bar clock (in Date & Time preferences), and set the Clock application (via its preferences dialog) to display in the Dock. You can choose analog or digital display, but the digital display has the advantage of also showing the date.

Tip

In OS X 10.3, you can enable a floating, translucent “clock” via the Clock tab of the Date & Time pane of System Preferences. (Specifically, change the “View in” setting from Menu Bar to Window.)

DVD Player

If you’ve ever watched a movie on your DVD-capable Mac, you’ve used DVD Player. Although most of the controls and preferences are fairly straightforward, there are a few functions and commands that most people haven’t discovered.

At any time you can view information about the current movie (time elapsed/remaining, chapter/ track number, audio information) by choosing Window Ø Show Info. (When the info window is visible, Show Info changes to Hide Info.) You can control the color and size of the info window via the DVD Player preferences dialog. (You can toggle between Info window styles via Window Ø Use Standard/Wide Info Window.) You can even choose to view subtitle text in a separate window.

Tip

One of the killer features added to DVD Player in OS X 10.3 is the ability to watch movies on any connected display—previously, you could only use the “main” screen (the one with the menu bar). Simply drag the Viewer window to whichever screen you want to use for viewing. In addition, also as of OS X 10.3, you can watch movies using an external DVD drive.

Advanced Controls

One of the most common questions about DVD Player is how to take advantage of special controls such as scan, slow motion, and frame-by-frame advance. At first glance, DVD Player doesn’t appear to provide such functionality; however, it really is there.

To scan, simply hold down the forward/reverse track buttons; the speed of the scan is determined by the setting in the Controls Ø Scan Rate submenu. To access other advanced controls, double-click the tiny tab at the edge of the controller (on the right side for a horizontal controller, at the bottom for a vertical controller). A drawer will slide out (Figure 7.6) with six additional controls: Slow, Step, Return, Subtitle, Audio, and Angle. (Hold the mouse cursor over a button to view a “tooltip” that shows you what the button does.)

Figure 7.6: DVD Player’s advanced controls
Playing DVDs Automatically

If you want a DVD to start playing automatically when you insert it into your Mac, the procedure isn’t entirely clear. First, you need to open the CDs & DVDs pane of System Preferences and choose Open DVD Player in the “When you insert a video DVD” pop-up menu. Second, in DVD Player preferences, you need to go to the Player panel and check the “When a disc is inserted: Start playing disc” box. When you have both these settings selected, inserting a DVD video will cause DVD Player to launch and automatically start playing the disc.

Tip

If you tend to watch movies on your Mac at night, you may find the shareware iSleep (http://isleep.free.fr/) useful. It works with DVD Player and allows you to choose any of a number of actions to be performed when the movie has finished or after a certain amount of time has elapsed: pause, stop, quit, put the computer to sleep, or shut down the computer.

Using DVD Bookmarks

Another feature added to DVD Player in OS X 10.3 is bookmarks. As you’re watching a DVD, if you want to “mark” the current spot in a movie, choose Controls Ø Add Bookmark… In the dialog that appears, give the new bookmark a useful name (and, if desired, make it the “preferred” bookmark). Whenever you want to access your bookmarks for a particular DVD, choose Go Ø Bookmarks Ø bookmark.

Taking Advantage of DVD Player Scripts

Like iTunes and a few other Mac OS applications, DVD Player has its own script menu and includes several AppleScripts “out of the box.” The Go To Time… script, for example, lets you go directly to a specific time on the DVD. You can find a number of additional useful scripts at http://www.digitallyobsessed.com/software.php3; a useful set, "Four Scripts for Previewing DVDs in DVD Player," lets you view the first few seconds of each chapter of a DVD in sequence.

Using Multi-channel Sound Output

If you have a set of external multi-channel speakers—specifically, ones that can take the digital output from newer Macs—you can output multi-channel audio from your DVDs using DVD Player. However, like accessing DVD Player’s advanced controls, doing so isn’t immediately obvious. Once you’ve connected your speakers to your Mac, open DVD Player preferences and switch to the Disc Setup screen. From the “Audio output” pop-up menu, choose “Digital Out – Built in Audio.”

Taking Screenshots of DVDs

Unfortunately, you can’t take a screenshot of a DVD using the standard Mac OS X screenshot functionality. However, you can do so using the freeware DVD Capture (http://www.digitallyobsessed.com/software.php3). When launched, DVD Capture provides its own controller that allows you to play and pause DVDs (You should pause a DVD before taking a picture of it.) You can choose to save the screenshot to the clipboard or to a file. You can even choose to delay the capture for a few seconds, in case you want to include any menus or the DVD Player controller in your picture. (You can also take screenshots of DVDs using the third-party utility Snapz Pro X, discussed later in this chapter.)

Font Book

Font Book is Apple’s own font management utility, new in Mac OS X 10.3. Unfortunately, fonts and font management are two topics that are, in all honesty, too complex to get into here—I just couldn’t do them justice in a few paragraphs. I provide a few resources for learning more about fonts, and Font Book, on the book’s website, http://www.macosxpowertools.com/.

Image Capture

Image Capture is used by iPhoto to automatically download pictures from your digital camera; however, most users aren’t aware that you can also use Image Capture by itself. In fact, for some uses it’s much faster and more convenient than iPhoto, and it offers features not available anywhere else.

Once you’ve connected your camera and turned it on, Image Capture provides you with several options. First, you can choose where you want images to be downloaded (from the Download To pop-up menu). Second, from the Automatic Task pop-up, you can decide what you want Image Capture to do with the photos once they’re downloaded. The default is to do nothing, but you can have Image Capture create a slide show or Web page showing the pictures, automatically resize or crop the pictures to various dimensions, or preview the images (using the Preview application). Click the Download button to download all the photos on your camera using the settings you’ve selected. (The progress dialog shows you how many photos are left to download, and a preview of each image is shown as it’s being downloaded.)

Tip

If you happen to use AppleScripts to post-process images, place a copy of (or alias to) each AppleScript in /Library/Image Capture/Scripts. Your scripts will appear in the Automatic Task pop-up menu and Image Capture will be able to process downloaded photos using them.

Where the more advanced features of Image Capture come into play are under the Options and Download Some screens. Click the Options… button, and you’ll see several tabs. The Download Options tab lets you add custom data (custom icons, Get Info comments, and ColorSync profiles) to photos as they’re downloaded, as well as delete photos from the camera after downloading them. You can choose to have photos downloaded automatically when your camera is connected, and you can set your camera’s date and time, if needed. The Device Options tab provides information about the camera or scanner that’s currently connected.

The View Options tab provides some interesting settings (icon size, list view columns, etc.), but you may be wondering where this mysterious “view” is located? That’s where the Download Some screen comes in. If, instead of clicking Download to download all the pictures on your camera, you click Download Some… , you’re presented with an advanced screen that shows (by icon or list view) previews of all the photos currently on your camera. If you choose list view (from the View toolbar item or the View menu), you’re also provided with all of the columns you checked in the View Options dialog (Figure 7.7). Some of this information—aperture, exposure, shutter, f-number, etc.—is incredibly useful and not easily viewed anywhere else in Mac OS X. Just like in the Finder, you can change the order of columns in list view by dragging a column header left or right, and you can sort by a column by clicking that column header.

Click To expand
Figure 7.7: The Download Some screen of Image Capture

In the Download Some window, you can rotate photos left (counterclockwise) or right (clock- wise) before downloading them. You also have the same options that are available in the main Image Capture window—download locations and automatic tasks—as well as quick access to the Options dialog. To choose photos for downloading, command-click them, or drag the mouse across multiple photos. Once you’re ready, click the Download button to download the selected photos.

Tip

In the Download Some window, you can customize the toolbar to add a Thumbnail Size slider, that allows you to dynamically resize the photo previews shown in icon view, and a Take Picture item that, when clicked, immediately takes a picture using the connected camera.

The Image Capture preferences dialog provides access to a few basic settings, as well as some hidden, but extremely powerful, ones. In the Camera tab you can decide the action you want Mac OS X to take when you connect your digital camera: do nothing (“No application”), open iPhoto, open Image Capture, or launch another application or AppleScript. If you have a supported scanner, the Scanner tab lets you choose to have a scanning window opened automatically when Image Capture is launched, as well as whether or not to use available TWAIN drivers. (TWAIN is a standard for creating software/drivers that communicate between applications and imaging devices, such as scanners.)

Tip

Whereas iPhoto downloads only images, Image Capture will also download movies and sounds from your camera and automatically save them in the Movies and Music folders, respectively, in your home directory.

Finally, the Sharing tab of Image Capture preferences offers some additional features that go way beyond basic settings. I talk about these features in the next section.

Sharing Your Camera or Scanner Using Image Capture

In Mac OS X 10.3, Apple added a major group of features to Image Capture… and then didn’t really tell anyone about those features. OK, so they’re briefly mentioned on the Mac OS X pages of the Apple website, but most people haven’t read those.

First, if you enable “Look for shared devices,” you can access a camera or scanner being shared by another OS X Mac. Choose Devices Ø Browse shared devices… to view shared cameras and scanners; when you select one in the “Browse Shared Cameras and Scanners” dialog and click OK, Image Capture will let you use that device as if it were actually connected to your Mac.

OK, so that’s pretty neat. But the really cool features are related to you sharing your devices. In the Sharing tab of Image Capture Preferences, enable the “Share my devices” option; from the list of devices, enable sharing for each device you want to share. Now, via the magic of Rendezvous (discussed in Chapter 9), any other Mac on your local network running OS X 10.3 or later will be able to access your camera or scanner (using the procedure described in the previous paragraph). They’ll be able to download pictures, take pictures, scan documents, etc.—all remotely. (If you have an iPod that you use to store photos, you can also share your iPod via Image Capture.)

Even more impressive, in my opinion, is what happens when you enable the Enable Web-Sharing option: Using the URL that appears, you, or anyone else—anywhere on the Internet—can access your shared devices via their Web browser! In the case of cameras, they’ll be able to view, download, and/or delete all the photos on the camera and (with certain newer cameras) even take pictures with it (Figure 7.8). You can even use the Web interface to set the camera up to take a picture at regular intervals—you basically have your very own webcam. In the case of scanners, remote users will be able to scan items using your scanner; this feature is mainly useful as an alternative to faxing a document or if the other user is nearby and doesn’t have a scanner of their own.

Figure 7.8: Accessing a shared digital camera via Image Capture’s Web-Sharing feature
Note

If your Mac is behind an Internet router, the Web URL provided by Image Capture will be based on your internal IP address. Be sure to read the sections on IP addresses and Internet routers in Chapters 9 and 11 for more info on how someone outside of your local network can connect to that address.

Regardless of which type of sharing you’ve enabled (local or Web), the “Shared name” is the name that your shared devices will appear under, either in other users’ “Shared Cameras and Scanners” dialog or on the Web browsing/monitoring page.

Internet Connect

Internet Connect is a catchall application for initiating dial-up, AirPort, and VPN connections. I’ll cover each of these functions in Chapters 9 and 11.

Mac Slides Publisher

Like Backup, Mac Slides Publisher isn’t installed by Mac OS X; it’s available only to .Mac subscribers. I mentioned in Chapter 2 that you can publish photos on your iDisk to be used as a slide show by the Screen Effects preference pane. Mac Slides Publisher allows you to do this quickly and easily. Simply select a group of photos in the Finder or in iPhoto (make sure they’re all in JPEG format) and then drag them onto the Mac Slides Publisher icon. Mac Slides Publisher will optimize the photos for size and then upload them to your iDisk (using the member name and password entered in the .Mac tab of .Mac preferences).

To subscribe to another member’s slide show (or your own, for that matter), open the Desktop & Screen Saver pane of System Preferences. Switch to the Screen Saver tab, select the .Mac screen saver module, and then click the Options button. Enter the .Mac member name, choose your preferred Display Options, and then press OK. Since you’ll be downloading the pictures from an iDisk, you must be connected to the Internet for this to work, but if so, you’ll now have a slide show screen saver using the pictures the .Mac member has provided.

Preview

Preview is Mac OS X’s universal image/graphics viewer and converter. In Mac OS X 10.2 and later, it can be used to view the following formats: BMP, GIF, JPEG, JP2 (JPEG2000), MacPaint, PDF, Photoshop, PICT, PNG, QuickTime Image Format, SGI, TGA, and TIFF; Mac OS X 10.3 adds the ability to view PostScript and EPS files. In addition, using File Ø Export… , it can export to all of these formats except GIF, PostScript, and EPS. (You can export as a PostScript file using a procedure I’ll cover in Chapter 12.)

While viewing an image file in Preview, you can zoom in and out to get a better view—hold the option key down to zoom in smaller increments. You can also rotate the image left or right, flip it on either axis, and even crop a selection within the image, making Preview a nice tool for quickly performing basic image editing functions.

Tip

You can actually view animated image files (such as the animated GIFs that are common on the Web) in Preview. Choose View Ø Customize Toolbar, and add the Play button to the toolbar. Open the animated file in Preview, and then click the Play toolbar item to view the animation. (When you view such a file in Preview, the thumbnail drawer will also show each frame as a separate thumbnail.)

New to OS X 10.3 is Preview’s ability to select and copy text from PDF files: If you click the “A” button—which evidently means “Text Tool” in hieroglyphics—in the Tool Mode toolbar item (or choose Tools Ø Text Tool), your cursor changes into a standard text cursor, which you can then use to highlight text for copying. (To highlight a single column of text in a multi-column PDF, hold the option key down as you drag the cursor.)

If an image or PDF file is too big to fit in the current Preview window, you can use the Scroll Tool (the button that looks like four arrows) to click anywhere in the document and then drag the document around within the window to shift the visible area. You can also choose View Ø Zoom To Fit to resize the document to fit in the current window. (If you’re wondering, the third Tool Mode button—the dotted square—is the Crop Tool, which lets you select an area of the current image to crop.)

If you open a multi-page PDF file or fax document in Preview, a drawer will slide out of the Preview window, presenting you with thumbnail previews of the document’s pages; click one to immediately go to that page. If a PDF file provides a “table of contents,” you can use the buttons that appear at the top of the drawer to switch between the list of pages and that table of contents. If you’d rather not see the thumbnail drawer at all, click the Drawer item in the toolbar.

The thumbnail drawer is also helpful if you want to open multiple files: If you drag images onto the Preview icon one at a time, or use the Open menu item and select them individually, each file will open in a new Preview window; however, if you drag multiple files onto the Preview icon in the Finder or the Dock, a single Preview window will open showing all of the files, and you can switch between images using the thumbnails in the drawer.

If you find that the thumbnail drawer really slows Preview down, in Preview preferences you can choose whether the drawer provides an actual image of each page/file, just the page/file name, or both. In OS X 10.2, I set mine to show only the name, which made Preview function much faster; however, OS X 10.3’s version of Preview is significantly faster in every respect, so I now tend to use the “Show image and name” option.

Here are a few other tips to help you get more out of Preview.

Tip

I mentioned that Preview can view PostScript and EPS files. Since you can print to any supported printer from within Preview, this means that you can use Preview to print PostScript and EPS files directly to a non-PostScript printer! (If this doesn’t impress you, trust me…it’s a big deal.)

Search PDFs via Preview

Mac OS X 10.3 also added live text searching of PDF files to Preview, and it’s pretty darned impressive. To see what I’m talking about, open a long PDF document. (If the drawer isn’t showing, click the Drawer button in the toolbar to open it.) Type a few letters in the Search field, and Preview will search as you type, narrowing down the search as you type more letters. You’ll get a list of matches, including a short excerpt of the surrounding text to provide context. Click a result in the list, and Preview immediately jumps to the corresponding page and highlights the search term to make it easier for you to find (Figure 7.9).

Click To expand
Figure 7.9: Preview’s search function finds and lists all occurrences of your search term.
Always Use Preview Instead of Acrobat Reader

If you’re using OS X 10.3, Preview is now good enough that you may never need to use Adobe’s Acrobat Reader again. However, although PDF files created by Mac OS X or Preview will be opened in Preview by default, most PDF files you download from the Web or receive via e-mail will automatically open using Acrobat Reader. You can force Mac OS X to open all PDF files in Preview using a trick I mentioned in Chapter 5.

  1. In the Finder, select any PDF file that has an Adobe Acrobat icon.

  2. Choose File Ø Get Info (or press command+I).

  3. Expand the “Open with” panel.

  4. Choose Preview from the pop-up menu.

  5. Click the Change All… button.

If you have a particular PDF file you want to open using Acrobat Reader—for example, maybe you need to use Reader’s form editing feature for that document—you can still drag it onto the Acrobat Reader icon, or choose File Ø Open… from within Adobe Acrobat.

Using Preview to Save Edited Adobe Acrobat Forms

Acrobat Reader includes the ability to fill in PDF forms for printing. However, it doesn’t allow you to save the form, meaning that if you close the PDF file, the next time you open it you have to fill in the form all over again. If this sounds familiar to you, here’s a time-saving tip: Fill out the form in Acrobat Reader, and then choose File Ø Print…, but don’t click the Print button. Instead, at the bottom of the window, click the Save As PDF… button. Choose where to save the file, and then click Save. The resulting PDF file will look exactly like the original form, except that it will have your information saved. You won’t be able to further edit the form using Acrobat Reader, but you still have the original for that.

Note

Mac OS X’s printing dialogs actually use the Preview application to save files to PDF format. I’ll talk more about this feature in Chapter 12.

This ability to “print to PDF” and the ability to re-save PDF files from within Preview aren’t always good things from the point of view of a PDF’s creator. PDF files created by Adobe Acrobat can implement certain security features that prevent actions such as printing and copying text. Re-saving a PDF file from within Preview, or (if printing is enabled) “printing” to a PDF file, effectively defeats many of these protections. Preview was actually a worse offender in Mac OS X 10.1 and earlier—it didn’t honor any of these protections at all (and you didn’t have to re-save a file to defeat its security).

QuickTime Player

QuickTime Player allows you to play multimedia files, including such common audio and video formats as MP3, MPEG-4, WAV, AIFF, AAC, AVI, and, of course, QuickTime. You can view or listen to multimedia files stored on your own computer, or you can play content “streamed” over the Internet.

Tip

If you get annoyed by the promotional video for some new movie or game that always pops up when you launch QuickTime Player, choose QuickTime Player Ø Preferences Ø Player Preferences… and then uncheck the “Show Hot Picks movie automatically” box.

If you click a link for a supported streaming media format in your Web browser, QuickTime Player will open automatically and begin to play it. If you have the URL of a streaming media file, choose File Ø Open URL in New Player… and type (or paste) the URL into the dialog. You can control playback options such as the size of the playback screen using the Movie menu, and you can save your favorite movies and streaming URLs as favorites using the Favorites menu.

Note

Some AVI movies don’t play properly on the Mac. You may be able to convert these problematic AVIs to Quick- Time’s .mov format using DivX Doctor II (http://doctor.3ivx.com/).

Each QuickTime Player window has its own volume and playback controls, but there are a couple hidden controls, as well. If you click the mouse in the progress bar in a Player window, you can jump directly to any part of the file. (If the file is located on your computer, playback will resume immediately at the chosen location; if it’s a streaming file, it will take a few seconds to re-buffer the content at the new point of playback). If you have a mouse with a scroll wheel, rotating the scroll wheel during playback will enter frame-by-frame mode; you can then use the scroll wheel to advance or rewind one frame at a time. (Click the play button, or press the space bar, to resume normal playback.)

If you’re playing a file with audio content, you’ll see a graphical audio display on the right side of the progress bar. If you click this display, the progress bar will switch to an audio control panel with balance, bass, and treble controls. (Click the display again to switch back.)

Tip

If you find that you just can’t get QuickTime Player to play a particular movie loud enough, hold down the shift key as you press the up arrow key (volume up). When the volume slider is all the way to the right, keep pressing the up key, and you’ll find that the volume continues to get louder!

Finally, if you upgrade to QuickTime Pro, QuickTime Player provides additional editing options, import/export options, video effects and codecs, and the ability to create your own QuickTime files from scratch.

Note

Another “hidden” trick, though one that’s more interesting than useful, is that QuickTime Player can actually “play” PDF files. To see this feature in action, choose File Ø Open Movie in New Player… and then choose a PDF file in the Open dialog. (Alternatively, you can hold down command+option as you drag a PDF file onto the QuickTime Player icon in the Finder or the Dock.) While viewing a PDF document, you can use the progress bar (or the left/right arrow keys) to move between pages; clicking the Play button will simply scroll through the entire document automatically. (This functionality isn’t limited to PDF files; you can use QuickTime Player to view other image formats, as well.)

Script Editor

The Script Editor application is actually located inside the AppleScript folder (/Applications/ AppleScript). It allows you to write, record, and run scripts, as well as to view the AppleScript Dictionary for any application that supports AppleScript. I talk a bit about AppleScript in Chapter 5’s Online Supplement. If you end up learning how to write your own scripts, chances are you’ll start out using Script Editor.

Sherlock

Depending on what version of the Mac OS you’re using, Sherlock is one of any number of different applications or utilities—Apple seems to change their mind about what they want it to be with each system release. From Mac OS X 10.2 on, it’s Apple’s Internet information search tool, which, when connected to the Internet, allows you to search for information via channels. Although it has an Internet search channel that scours a number of the major Web search engines, as well as a Picture channel that uses those search engines to search for images, most of the channels are, in fact, very topic-specific. Apple’s built-in channels are viewable by selecting the Apple Channels item in the Collections sidebar (Figure 7.10). You can view other channels by selecting other Collections. For example, if you’ve added third-party channels to Sherlock (see below), selecting Other Channels will list them. Drag your favorite channels to the My Channels item to make them easier to access in the future—selecting My Channels will show only your favorites. You can also add a channel to the toolbar or the Channels menu by dragging it to the appropriate item in the sidebar.

Some examples of information you can gather using Sherlock’s built-in channels are movie times and locations in your area (you can even view movie trailers); the latest stock updates and news; residential phone listings; business information using the local yellow pages; word definitions and translations; and items for sale on the eBay auction site. You can even get the latest flight status information from major airlines. (Sherlock doesn’t do any of this searching itself; rather, it queries available search engines and websites and then returns the results to you within its own window. You won’t get “better” results than if you had used these search engines and websites yourself, but you get a nice, neat, all-in-one interface to many different data sources.)

Click To expand
Figure 7.10: Sherlock’s channels
Tip

When a particular channel is being viewed, choose Channel Ø Make a Shortcut… You’ll be asked to name the shortcut and choose a location to which to save it. The resulting shortcut file works much like an alias to Sherlock, except that it opens Sherlock to the specific channel. (This shortcut file is actually an Internet Location file; I’ll talk about these files in Chapters 9 and 12.)

Sherlock sounds like a great utility, and it is. However, I don’t use it all that much; I generally prefer to use Watson, discussed in the next section.

My Dear Watson: A Better Sherlock

The shareware Watson (http://www.karelia.com/watson/) is a utility that looks and works similarly to Sherlock (Figure 7.11). Like Sherlock’s "channels," Watson’s "tools" are content-specific modules that allow you to gather information via the Internet. However, Watson offers most of the features of Sherlock, plus many more.

Click To expand
Figure 7.11: Watson, Sherlock’s more capable twin

As Table 7.1 shows, Watson’s tool list is quite extensive, and it provides access to many additional types of information, from news to recipes to weather, not available through Sherlock. Watson is also extensible via a plug-in architecture—some of the tools were provided by third parties—so new tools are available regularly.

Table 7.1: Comparing the “Stock” Plug-ins of Sherlock and Watson
Sherlock “Channels” | Watson “Tools”
Internet | Google Search, Yahoo
Pictures | Image Search
Stocks | Stock Tracker
Movies | Movies
Phone Book | Phone (white, yellow, toll-free)
eBay | eBay Watcher
Flights | –
Dictionary | Reference (dictionary plus many more sources)
Translation | Translation
AppleCare | –
– | Amazon.com
– | Astronomy (search for facts and info)
– | Baseball Scores
– | Epicurious, RecipeSource (recipes)
– | Exchange Rates (currency)
– | Football Scores
– | iMedia (independent media)
– | Meerkat (tech news/information)
– | Packages (Airborne, FedEx, UPS, USPS tracking)
– | PriceGrabber (shopping price comparisons)
– | SiteSearch (access to many sites’ search engines)
– | TV
– | VersionTracker
– | Weather
– | Zip Codes

The channel in which Sherlock has a clear advantage over Watson’s tools is AppleCare—you can search and view the entire AppleCare Knowledge Base of articles, making Sherlock a quicker way to access this content than even Apple’s own website. (Although if you click a link within a document in Sherlock, it will open in your Web browser.) Sherlock’s Phone Book channel also has a few nice touches: Once you locate a person or business, Sherlock downloads a local map showing you the location of the residences or business, and (if you’ve entered your address in the preferences dialog), can provide you with specific driving directions. Finally, Watson doesn’t have an airline flight status tool.

However, apart from these channels, I find Watson’s tools to be either comparable or preferable. For example, Watson’s Phone tool searches white pages, yellow pages, and toll-free directories, and provides reverse-lookup functionality; its Reference tool searches many more databases, and many more types of databases, than Sherlock’s Dictionary channel; and its Translation tool lets you choose between multiple online translation engines, compared to Sherlock’s one. Sherlock is free with Mac OS X, but if you do a lot of online searching and information gathering, Watson is well worth the price.

Note

There’s actually a bit of controversy surrounding Sherlock and Watson. When Watson was first released, Sherlock looked and worked much differently (truth be told, it wasn’t very popular). Watson got rave reviews and even won Apple’s own “Most Innovative Mac OS X Product” award. Come OS X 10.2, Sherlock got a major makeover that left it working (and, at the time, looking) suspiciously like Watson. The two utilities aren’t exactly the same, but they’re close enough to raise some eyebrows.

Using Sherlock Location Files and Adding Third-Party Sherlock Channels

If you find yourself doing frequent searches using a particular Sherlock channel, you can actually create Sherlock Location files that, when opened in the Finder, launch Sherlock to the appropriate channel and initiate your search. In addition, as I mentioned above, many third-party developers and sites provide their own Sherlock channels that you can install and use quite easily. Unfortunately, I don’t have the space to show you how to do these things here. However, you can visit the book’s website at http://www.macosxpowertools.com/ for the juicy details; I’ve included some good information in the "Sherlock Shortcuts" section.

Stickies

The Stickies application is the Mac OS X adaptation of the old Mac “Post-It Note” standby. You can quickly create notes and “stick” them on the screen. Although many users consider Stickies to be something of a novelty, with limited functionality, those who haven’t yet used OS X’s version may be surprised by what Stickies can do.

As with the OS 9 version of Stickies, you can create as many notes as you like, each with styled text and the “paper” color you choose. You can also import text from a text file or export the contents of a Stickies note to a text file.

However, the similarities end there. In the OS X version of Stickies, you can also export to RTF and RTFD (an RTF file with graphics), and the application now supports text colors, character-level formatting (the pre–OS X version would only allow one format and font for an entire note), graphics (drag any picture or graphic into a note to insert it), and unlimited note size (the old version limited notes to 8,000 characters). It also provides a Find and Replace function that works within a single note or across all notes.

In addition, Stickies also sports some OS X touches. From the Note menu, you can make individual notes translucent, and you can also choose to make certain notes “float,” meaning that they float above other application windows (making them behave like real notes stuck to your screen). Stickies notes also take advantage of OS X’s Cocoa spell checker, available from the Edit menu. Finally, in any Cocoa or Services-compatible Carbon application, you can select text and then choose Application Name Ø Services Ø Make New Sticky Note to create a new note with the selected text as its contents. (I’ll talk more about Services later in this chapter when I talk about working with text.)

Tip

If you used Stickies under Mac OS 9, and recently upgraded to OS X, you can choose File Ø Import Classic Stickies… to import your old notes into the OS X Stickies database (the old database is located at /Mac OS 9 System Folder/Preferences/Stickies file).

System Preferences

I cover the System Preferences application in detail in Chapter 2.

TextEdit

If you ever used SimpleText in Mac OS 9 or earlier, you know that it was (1) the built-in text editor, and (2) not very powerful or functional. TextEdit is similar to SimpleText in that it’s Mac OS X’s built-in text editor, but the two applications are much, much different in their capabilities. TextEdit is an extremely powerful text editor with enough functionality to actually be called a word processor. It supports files of unlimited size, complex formatting (such as colors, kerning, ligatures, and super/ subscripts), paragraph-level justification, find/replace, and graphics. It can open, edit, and save RTF- formatted documents, supports Unicode text and text-to-speech, and can even render HTML and PDF files (drop an HTML document on TextEdit and watch it render the page, including linked graphics). In fact, in Mac OS X 10.3 and later, it can even open, and save, Microsoft Word documents. (It can’t handle some complex Word features, but it works great with most basic Word files.) Like Stickies, it also supports Services and Mac OS X’s spell-checking features, but unlike Stickies, you can enable on-the-fly spell-checking (via the preferences dialog), just like Microsoft Word. Finally, when working in rich text (RTF) documents, you can access a formatting bar and a ruler that provides tab stops and margin settings. You probably didn’t even know about half of these features, right? Here are a few more tips.

Note

For some great information on the advanced typography options available in TextEdit, visit http://latourfl.com/blog/index.php/2003/11/16/8-TexteditAdvancedTypographyOptions.

Using Images, Sounds, and QuickTime Movies in TextEdit Documents

To include an image, sound, or QuickTime Movie in a TextEdit document—it must be a rich text (RTF) document (see “Options for Saving in TextEdit,” below)—drag it to the desired position in the document. A bit counterintuitively, to apply justification to one of these objects, select it in the document and then choose Format Ø Text Ø justificationtype. When you save the resulting document, the file extension will be .rtfd rather than .rtf. This signifies that the document includes non-text objects; in fact, it also signifies that the document is actually a package rather than a single file. If you control/right-click the document’s icon in the Finder and then choose Show Package Contents from the contextual menu (or select the document in a Finder window and then choose Show Package

Contents from the Action menu in the Finder window toolbar), you’ll see that the package contains a standard RTF document along with any non-text objects included in the document.

Setting Up New Document Attributes

Because TextEdit is so versatile, you need to decide what new documents will look like; you do this from the preferences dialog. First, you can choose between rich text (.rtf) and plain text (.txt) format. (Note that many complex formatting features aren’t available in plain text documents; if you’re working with a document in one format and want to change to the other, you can quickly do so by choosing Format Ø Make Plain Text or Make Rich Text.) You can choose the default window size, word wrap, and fonts for new documents (including a different default font for rich text and plain text files).

General Usage Preferences

The TextEdit preferences dialog offers a few other useful settings not specifically related to newly created TextEdit documents. You can choose what type of text encoding is used—and how rich text commands are handled—when opening and saving documents. (I generally recommend Automatic for the former, and leaving the latter options unchecked, unless you have a specific reason to choose otherwise.) You can also enable or disable the toolbar ruler and OS X’s built-in spell checker. Finally, you can set your preferences for saving documents, which I talk about in the next section.

Tip

If you open an HTML document in TextEdit, by default the file will be rendered (i.e., it will be shown as a “Web page” rather than as a text file). If want to use TextEdit to edit HTML documents, check the “Ignore rich text commands in HTML files” box in TextEdit preferences. This setting forces TextEdit to open these documents as standard text files.

Options for Saving in TextEdit

The TextEdit preferences dialog also gives you several options for saving files. By default, whenever you open and edit a file in TextEdit, it creates a backup of the original; when you save your changes, the backup file is deleted. By unchecking “Delete backup file,” you can keep the backup as well as your newly edited version. You can choose to overwrite files that have been marked as read-only (via Format Ø Prevent Editing) and to save such files in writable format. You can also choose whether or not to add the .txt extension to the names of files saved as plain text.

You also have three options for actually saving files: plain text, rich text, or Microsoft Word. How a file is saved is partially determined by your preference setting for new documents (rich text or plain text). However, you can change the format of a document at any time using the Format menu; the “Make Format Text” item lets you switch between plain text and rich text at any time. (Note that switching to plain text will lose any formatting you had in the document.)

To save a document as plain text or rich text, make sure the document is in the preferred format and then save normally. However, saving a document in Word format requires an extra step. First make sure that the document is in rich text format; then use File Ø Save As… , choosing Word Format from the File Format pop-up menu.

If you use TextEdit to create or edit preference and/or configuration files (as discussed in various places in this book), make sure, before you save any changes to a document, that TextEdit is treating the document as a plain text file. The reason for this is that rich text (.rtf) files contain formatting characters that will prevent your preference/configuration files from working properly.

Zooming in TextEdit

You can actually zoom in on and out of a document in TextEdit; this can be useful for examining small details or for seeing the “big picture” of how a document looks as a whole. (By zooming in, you can also see how beautiful text rendering is in Mac OS X—no matter how much you magnify text, it still looks sharp and smooth, as shown in Figure 7.12.)

Figure 7.12: Using TextEdit’s zoom function

To use this feature, choose Format Ø Wrap to Page. The document view will change to a page layout orientation, and a zoom menu will appear in the lower-right corner. Select a zoom amount (from 10 percent to 1600 percent), and the page will be reduce or enlarged accordingly. To get back to window view, select the same menu item (which now reads Wrap to Window).

Tip

You can create a page break within a TextEdit document, provided the document is in rich text format, by enabling the “Wrap to Page” option, placing the cursor at the desired page break location, and then pressing control+Q followed by control+L.

Mac OS X’s Utilities

I usually describe utilities as applications that let you change or monitor your Mac’s behavior or that help you better take advantage of your Mac’s built-in capabilities. Although that’s a good catchall description, for the purpose of this part of the chapter I’ll use Apple’s practical categorization of what a utility is: any application found in /Application/Utilities.

Activity Monitor

Activity Monitor is OS X 10.3’s version of the Process Viewer utility found in OS X 10.2 and earlier. Via the main Activity Monitor window—accessible via Monitor Ø Show Activity Monitor if it’s not already visible—it shows currently running processes (applications and background processes), provides information about each, and (using the Processes menu or the buttons in the toolbar) allows you to quit or force quit the selected process. (I’ll talk about force quitting applications later in the chapter, in “Dealing with Application Freezes.”)

By default, Activity Monitor shows you just the processes started by you (which includes those you manually launched, those started at login, and those started by Mac OS X for your particular account). However, by choosing All Processes from the Show pop-up menu, you can view all running processes. (The Show pop-up menu provides a number of additional views to help you monitor different types of processes.) You can use the Filter field to quickly find a particular process.

Regardless of which processes you’re viewing, you can view the process ID (PID) of each process; the user who started it (the current user’s username for user-level processes, root for system-level processes); the current percentage of CPU time being used by it; the number of threads (a programming term for the number of parallel activities a process is executing) in it; and the amount of real and virtual memory being used by it. You can sort the process listing by any of these values by clicking the appropriate column head (clicking the currently highlighted column head reverses the sort order). Activity Monitor can be quite useful for monitoring which applications are bogging down your CPU or hogging lots of memory.

If you’re interested in the nitty-gritty behind a process, selecting that process in the list and then clicking the Inspect item in the toolbar provides you with more detailed information, such as the parent process (if the process was launched by another process), comprehensive memory statistics, and a list of files (including program and source files) being used by the process. For example, the Parent Process information for the service syslogd—(init, 1)—tells you that it was launched by Mac OX’s boot initialization routine.

Tip

Classic applications will not be listed in Process Viewer; only the Classic environment itself will be visible (as either “TruBlueEnvironme” or “(null)”). To see a listing of Classic processes, open the Classic pane of System Preferences and select the Memory/Versions tab.

The Export button in the toolbar will export an XML-formatted report—in the form of a .plist file—that includes detailed information about each process, along with a summary of all process. Although this report won’t be very useful to most users, it may help a developer’s tech support department help you solve a problem.

Start Sidebar
Panther vs. Jaguar: Where Did My Utilities Go?

As they do with most major updates to Mac OS X, in the transition from OS X 10.2 to OS X 10.3, Apple changed the names of some utilities and integrated the functionality of others into either new utilities or new versions of existing utilities. Here’s a quick summary of these changes:

Mac OS X 10.2 | Mac OS X 10.3
Apple System Profiler | renamed System Profiler
CPU Monitor | integrated into Activity Monitor
Disk Copy | most functionality found in Disk Utility
Key Caps | removed, replaced by Keyboard Viewer palette
Print Center | renamed Printer Setup Utility, some settings in Print & Fax preferences
Process Viewer | renamed Activity Monitor

There are also a few other minor utility-related changes. For example, OS X 10.2’s Display Calibrator utility still exists in OS X 10.3; however, it’s no longer out in the open. Under 10.3, it’s located at /Library/ColorSync/Calibrators/Display Calibrator; you can access it more easily via the Calibrate… button in the Color tab of System Preferences.

End Sidebar
Activity Monitor’s…Monitors

Mac OS X 10.2 and earlier have a small utility called CPU Monitor that let you view a graphical representation of your Mac’s CPU load. In OS X 10.3, this functionality is integrated into Activity Monitor and is accessible from the main Activity Monitor window. Even better, Activity Monitor lets you monitor not just CPU load but also memory (RAM), disk activity, disk usage (how much free space is available), and network activity. To view any of this information from within Activity monitor, simply click the appropriate tab at the bottom of the Activity Monitor window (Figure 7.13).

Figure 7.13: Activity Monitor’s main window, displaying user-level processes and, via the System Memory tab, memory usage
Tip

If you’re looking for the CPU usage windows provided by OS X 10.2’s CPU Monitor, they’re available from the Monitor menu. Choose Monitor Ø Show CPU Usage for the “standard” version, Monitor Ø Floating CPU Window Ø Show Horizontally/Vertically for the “floating” version, or Monitor Ø Show CPU History for the “expanded” version. Likewise, you can view CPU load—or even CPU history, network usage, disk activity, or memory usage—in real-time in the Dock by choosing Monitor Ø Dock Icon Ø Show choice; a graph will replace the Activity Monitor icon. (You can also access any of these items from Activity Monitor’s Dock menu.)

AirPort Admin Utility and Setup Assistant

These two utilities allow you to set up and manage AirPort networks. If you have a Mac with an Air- Port card installed, the AirPort Setup Assistant walks you through the steps needed to join an existing AirPort network or to set up an AirPort Base Station from your computer.

The AirPort Admin Utility allows you to manage an AirPort Base Station. Using the Admin Utility you can restart or reset your Base Station, upload firmware, upload a saved Base Station configuration file, set up an AirPort network password (Equivalent Network Password), and configure various other AirPort Base Station settings (e.g., DHCP, NAT). Under OS X 10.3 and later, you can actually configure multiple Base Stations at once via the Base Station Ø Configure multiple… command.

Note

The AirPort Setup Assistant requires you to have your AirPort settings set to DHCP; if you don’t want to use DHCP, you need to use the AirPort Admin Utility.

Bluetooth File Exchange

If your Mac supports Bluetooth and you have another Bluetooth device (such as another Bluetooth- equipped Mac or a Bluetooth phone or PDA), Bluetooth File Exchange lets you send files to another device and to browse other Bluetooth devices (if browsing is enabled on those devices) in order to download or upload files. I’ll talk about how to do this and how to use Bluetooth File Exchange in Chapters 10 and 11.

Bluetooth Setup Assistant

The Bluetooth Setup Assistant walks you through the process of setting up a new Bluetooth device for use with your computer. I’ll mention it in the context of the Bluetooth pane of System Preferences in Chapter 9.

ColorSync Utility

The main function of the ColorSync Utility is to verify and repair ColorSync/ICC device profiles on your Mac. These profiles—for displays, printers, scanners, cameras, and other ColorSync-compatible devices—ensure color accuracy across devices. (For example, to make sure that a photo scanned on a supported scanner prints accurately on a supported printer.)

You can view installed profiles from the Profiles panel. Click the disclosure triangle next to any group of profiles to view the contents of that group; clicking the small triangle in the upper-right corner of the Profile list window allows you to group profiles by location, class, or space. Select a profile to view details about it, including a 3D graph of its lab plot. You can view information about connected devices from the Devices panel. Click a device (a display, scanner, camera, printer, etc.), and you’ll be presented with information about the device to the right. From the info area you can also select a specific ColorSync profile for the device.

The Profile First Aid panel lets you verify or repair installed profiles, and the Preferences panel lets you choose the default profile for various color schemes.

Finally, the Filters panel lets you view and create ColorSync/Quartz Filters. (I’ll talk more about these filters in Chapter 12; you can use them to alter the appearance of documents when printing.) You can view the settings for an existing filter by selecting it in the Filters list. However, you can also create your own by clicking the Add button (or by selecting an existing filter and clicking Duplicate). You can then use the “Filter details” tabs to customize the new filter. (You can even see how your filter will look when applied to an image or document by clicking “View file with Filter…”)

Console

While your Mac is running, Mac OS X is quietly keeping track of low-level system errors and messages. When you launch Console, the console.log file—the default log that is visible on launch—shows these errors and messages. (Don’t worry—even though it looks like there are a lot of problems, it’s normal for the log file to be filled with incomprehensible messages.) But more important for most users, the Console utility also lets you view the logs of application crashes. This information can often provide you with clues as to the cause of an application crash (useful if you’re trying to track down a persistent problem), and, in fact, many developers will request a crash log if you request technical support.

Note

In OS X 10.2, “crash reporting” is disabled by default. To enable it, choose Console Ø Preferences, click the Crashes tab, and then check the box next to “Enable crash reporting.” You can also choose to have crash logs displayed automatically; I personally find this option annoying, because each time an application crashes, Console will launch and pop up a window with the resulting crash log.

To view an application’s crash log after the application has crashed, launch Console and click the Logs item in the toolbar. From the Logs list on the left, expand either the /Library/Logs item (for system-level applications) or the ~/Library/Logs item (for applications running in your own account), and then look for the application’s name; if it’s not at the root level of the listing, it’s probably located under the CrashReporter item.

The log file will tell you what the “Exception” was (what caused the crash) and which of the application’s threads actually crashed (“Thread # Crashed”). Multiple crashes for the same application will be appended to the same log file; you can identify details for a specific crash via the Date/Time tag. Most of the time this info won’t make much sense to the average user; however, a couple times I’ve been able to make educated guesses about what the problem was (a corrupt font is one example).

If you’re looking for a particular bit of text in a log (e.g., “crashed”), type it in the Filter field at the top of the Console window. When you’re viewing a log, you can add a date/time stamp to it— in case you want to mark a certain point in the log—by placing the cursor in the desired location and then clicking the Mark item in the toolbar. Alternatively, you can clear a log completely by selecting it and clicking the Clear toolbar item (which keeps the log file but empties it) or by choosing File Ø Delete (which deletes the entire log file from your Mac).

If you want to view more than one log at once, you can choose File Ø New Log Window to open a second (or third, etc.) window; each window can be used to view a different log. If you want to monitor any log window in real time, the Console preferences can be set to notify you when a log changes (either by bouncing the Console icon in the Dock or by automatically bringing the log window to the front).

Finally, you can save a copy of a crash log (or any other log) by selecting it and then choosing File Ø Save a Copy As… If a developer ever asks you to send a crash log, this is what they want.

Note

Crash log files are actually located in /Library/Logs/CrashReporter and ~/Library/Logs/CrashReporter; the name of the offending application will be contained in the respective log’s filename. You can actually view these log files in any text editor, and the console.log and system.log files are also viewable in System Profiler.

DigitalColor Meter

Used mainly by those in the graphics, publishing, and design fields, DigitalColor Meter allows you to translate colors anywhere on your screen into color values in RGB, CIE, or Tristimulus format. From the pop-up menu in the DigitalColor Meter window, choose the color value format, and then move the mouse over any item or pixel on the screen to see its color value. You can control the aperture size of the selector using the Aperture Size setting in the main window, and you can choose the degree of magnification of the DigitalColor Meter inspector window from the preferences dialog.

Once you’ve found a color you want to use, press shift+command+H to “hold” it—you can then copy the color using the Color menu, or you can drag it from the color swatch to the storage area in Apple’s Color Picker window (assuming it’s open). You can also save the image in the inspector window or save it to a TIFF file for later use. If you’re a graphics professional, DigitalColor Meter has a number of other useful features (and you’re quite likely to already know exactly what they are and how to use them).

Directory Access

You use the Directory Access utility to configure access to directory services such as AppleTalk, LDAP, NetInfo, Rendezvous, and SMB. If you’re using your Mac at home and these terms mean nothing to you, don’t worry—Directory Access is pre-configured for use in small networks such as a home or small office, and, for the most part, you can safely ignore it. If you’re connected to a larger network that takes advantage of such services, chances are your network administrator will tell you how to set up Directory Access or will do it for you. There are a few quirks with Directory Access as it relates to sharing files, but I’ve explained them, where relevant, in Chapters 10 and 11.

“Disc Burner”

If you’re looking for this utility, you won’t find it, because it’s not really an application. Disc Burner is what Apple used to call the Finder’s ability to burn CDs and DVDs directly from the Finder. It’s really a function of the Disk Copy utility (in OS X 10.2 and earlier) or Disk Utility (in OS X 10.3 and later). However, since it appears to work independently of these utilities—it appears to be part of the Finder—I’m going to talk about this functionality separately.

If you have a Mac or an Apple laptop with a CD-R or DVD-R drive, inserting a blank CD (CD-R or CD-RW) or DVD brings up a dialog asking you what you want to do with it. If you choose Open Finder, the blank disc will appear in the Finder. You can drag items onto it (up to the point where you fill it to capacity), and they will be “copied” to the disc. (They actually aren’t being copied to the disc; they’re being copied to an invisible image of the disc that will later be burned.) When you’re ready to burn the disc, you can do so in one of three ways: (1) select it in the Finder, and then choose File Ø Burn Disc…; (2) drag the disc to the Dock’s Trash icon, which will turn into a “burn” symbol; or (3) click the “burn” icon next to the disc in any Finder sidebar. You’ll be asked at what speed you want to burn the disc (choose a speed equal to or less than the blank disc’s speed rating, usually printed on the face of the disc), and then you can burn it.

Note

CDs burned in the Finder are automatically created as hybrid CDs, meaning they’re compatible with both Macs and Windows computers. DVD-Rs burned in the Finder are compatible only with Macs.

If you instead choose to open the blank disc in iTunes or (if you have a SuperDrive Mac) iDVD, the appropriate application will appear, from which you can burn an audio, MP3, or data CD, or a DVD.

Finally, you can choose to open the disc in another application, such as another CD/DVD- burning utility, or to run a script, if you’ve set up an AppleScript to work with blank discs.

Note

For a few alternatives to the Finder’s built-in disc-burning functionality, see “Alternatives for Burning CDs and DVDs,” later in this chapter.

Start Sidebar
Panther vs. Jaguar: Disk Copy Bites the Dust

In Mac OS X 10.2 and earlier, the Disk Copy utility is the catchall utility for working with disk images—creating them, mounting them, burning them, converting them, etc. If you’re working with a disc image, you’re working with Disk Copy. It’s a great utility with a lot of great features.

However, in OS X 10.3, Apple did away with Disk Copy. Its disk mounting functionality was moved to a new, background-only, application called DiskImageMounter, located in /System/Library/CoreServices. Most of its disk creation, conversion, and burning capabilities were integrated into Disk Utility (discussed in this chapter). I say most because, unfortunately, not all of Disk Copy’s functionality survived the transition from OS X 10.2 to 10.3. For example, Disk Utility doesn’t provide the same range of options—segment sizes and resizing of images, for example—as Disk Copy. It also doesn’t allow you to set defaults for disc burning. Finally, whereas you could drag a folder or volume onto Disk Copy to create an image of that folder or volume, Disk Utility requires you to navigate through its menus to initiate the creation of such a disk image; in other words, the functionality is there, but it’s a lot less convenient.

The good news is that if you prefer OS X 10.2’s Disk Copy and you have a copy handy, it still works, for the most part, in OS X 10.3.

End Sidebar

Disk Utility

I’ve already mentioned the Repair Disk Permissions feature of Disk Utility; however, it has a good deal of additional functionality, divided into several main areas.

Information Select a disk or volume in the disk/volume list on the left, and you’ll be provided with detailed information about that disk/volume at the bottom of the Disk Utility window (Figure 7.14). If you select a physical drive, the information includes connection type and ID, total capacity, write status, and SMART status; if you select a partition of a drive, the information includes the disk format, capacity, space available, and number of files and folders. In addition, by selecting a disk/volume and clicking the Info item in the toolbar, you can get more detailed information about the disk/volume.

Click To expand
Figure 7.14: Disk Utility provides you with basic (top) and detailed (bottom) information about a drive.

First Aid Select a volume (a non-partitioned disk, or a volume of a partitioned disk) in the disk/volume list and then click the First Aid tab to verify or repair permissions or to verify or repair the volume itself. Note that you should only use the Repair Disk Permissions function on the boot volume, whereas you can only use the Repair Disk function on a non-boot volume.

Note

I talk more about the First Aid tab of Disk Utility, disk maintenance, and third-party disk utilities in Chapter 14. I also discussed the Repair/Verify Disk Permissions functions in Chapter 1.

Erase Select a disk or volume in the list and then click the Erase tab to view the erasure options; you can choose the volume format (Mac OS Extended is recommended) and the name of the volume post-erase. (If your Mac can boot into Mac OS 9, you may also have an option to install Mac OS 9 drivers on the disk.) If you select an entire disk, rather than just partitions of a disk, you can click the Options… button to access two additional erasure options. The “Zero all data” feature not only erases the disk directory but also overwrites every single sector of the disk with zeros, making recovery of the disk’s contents more difficult. The “8 Way Random Write Format” goes several steps further, writing random data to every single sector—eight times. This makes it much more difficult for anyone but the NSA to recover any data from your drive. Using one of these options is a good idea if you’re getting rid of your hard drive or computer. (Note that whatever options you choose, you can’t erase the boot volume.)

Note

If you’re interested in more information about securely erasing your hard drive, or just individual files, so that it’s virtually impossible to recover the data, I discuss the topic in more detail in Chapter 13.

Partition If you want to divide a single hard drive into two or more volumes (partitions), select the disk in the list and then click the Partition tab. You use the Volume Scheme panel to choose the number and size of the partitions. Note that you can’t partition the disk that contains the boot volume—which will erase the disk and its contents—without first booting off of a different disk. I talk more about partitioning drives in Appendix A.

RAID You can use the RAID tab of Disk Utility to set up a RAID (redundant array of independent disks) across multiple drives. Disk Utility offers a rather simple version of RAID, with only two options: striped (splits data across multiple disks for faster read/write access) and mirrored (duplicates data across multiple discs for reliability or for access by multiple users simultaneously). If you’ve set up a mirrored RAID, Disk Utility will also allow you to rebuild it in the case of a drive failure. To set up a RAID, drag multiple volumes to the Disk window and then select the scheme, name, and format. Note that RAID drives must be the same size and that you can’t set up a RAID using the startup disk.

Warning

Using the Erase, Partition, or RAID features of Disk Utility will erase the affected volumes/disks. Be sure this is what you want to do!

Restore In Mac OS X 10.3, Apple added a new restore feature to Disk Utility. Based on the command-line utility asr (Apple Software Restore), you can create a bootable disk image of a disk or volume (via Images Ø Image from volume/device…) and later restore that image back to the original volume or to a different volume altogether. The steps to perform the restore procedure are quite simple: drag a disk or disk image (the restore source) into the Source field (or use the Image… button to navigate your hard drive or network for the desired source image), and then drag the volume to which you want to copy the disk or disk image (the restore destination) into the Destination field. Checking the Erase Destination box will first erase the destination volume. (The Skip Checksum option will speed the process up dramatically; however, you should only use it if you’re sure the source image is error-free.)

Tip

If you get a new Mac, you can use Disk Utility’s restore feature to make an exact copy of your old hard drive and then “restore” that image to the new computer—an easy way to transfer your drive’s contents.

Disk Images Chances are, in the time you’ve been using Mac OS X, you’ve downloaded software via a disk image; you may have even downloaded a few disk images in the process of trying out one of the software titles I’ve recommended in this book. Disk Utility can actually create such disk images—of folders, of volumes, of hard drives, of CDs, or from scratch—and burn disk images to CD/DVD.

You may wonder why you’d ever create a disk image, but they can actually be quite useful. For one thing, if you’re sending a bunch of files to another OS X user, creating a disk image means you can send just one file (and, if you choose to create a compressed disk image, that file will be much smaller than the sum of all the files’ sizes). For another, you can encrypt disk images with a password; no one but you, or anyone you give the image’s password to, will be able to mount it or view its contents. I’ll explain how to work with disk images in the sections that follow.

Tip

If a disk image or connected volume is shown in the volumes list in Disk Utility but isn’t currently mounted, you can mount it by selecting it and then clicking the Mount item in the toolbar. Conversely, you can eject/unmount any mounted volume or disk image by selecting it and clicking the Eject item in the toolbar.

You can view (and even print) a log of all Disk Utility activity by choosing File Ø Log. You can also clear the log from the viewer window by clicking the Clear item in the toolbar—mine was more than 200 pages long!

Creating/Converting Disk Images

You can create several kinds of disk images using Disk Utility. You can create a new, empty image by choosing Images Ø New Ø Blank Image… (or clicking the New Image item in the toolbar). You’ll be presented with a dialog that lets you choose the size of the new image (the Size pop-up menu provides a few standard sizes, or you can choose your own); the format of the disk image (read/write or sparse; the latter will actually start out smaller than your preferred size and grow until you reach that size); and whether or not to use encryption. Once you’ve chosen a name for the image and a location to save it, the Create button creates it; if you chose to use encryption, you’ll be asked for a password.

You can also create a new image that’s an exact copy of a hard drive, CD, DVD, or other removable volume by selecting the volume in the list on the left and then choosing File Ø New Ø Image from device name. You’ll be presented with a Save dialog similar to the one described in the previous paragraph; however, Image Format choices will be read/write, read-only, compressed, or DVD/CD master. You can perform an identical action for a folder by choosing File Ø New Ø Image from Folder; you’ll then be asked to select a folder to image.

Disk Utility also allows you to convert an existing image from one image format/encryption combination to another by choosing Images Ø Convert….

If you create a new disk image with either the read/write or CD/DVD master format (or convert an existing image to one of these formats), the resulting image will be editable, meaning you can delete files from the image or add files to it.

Burning Disk Images to CD/DVD

If you have a disk image that you want to burn to CD or DVD, choose Images Ø Burn…. Select the image in the Open dialog and then click the Burn button. (Alternatively, if you’ve previously worked with the desired image in Disk Utility, you can select it in the volumes/images list on the left and then click the Burn item in the toolbar.) Once you see the Burn Disk dialog, click the expand triangle in the upper-right corner for more options; you’ll be able to choose the burn speed and a few post-burn options. If you want to be able to burn additional sessions to the same disc (in other words, to create a multi-session disc), check the “Leave disc appendable” box; you’ll be able to burn additional content to the disc in the future (provided you’ve placed the additional content on a disk image and use the Burn Image command to burn that image). I describe this process in the next section.

Creating Multi-session CDs

It’s possible to burn multiple sessions to a single CD in Mac OS X, but it’s not obvious how to do so. You must burn your data to disc using disk images and Disk Utility; you can’t use the Finder (Disc Burner). I hinted at this procedure in the previous tip, but here are the detailed steps to take:

  1. Create a new disk image (blank image, image from folder, etc.) with the first session of data.

  2. Use the Burn command in Disk Utility to burn the data to CD; in the Burn Disc dialog, click the expand triangle to view more options, and then check the “Leave disc appendable” box. This will allow you to burn the first session.

  3. The next time you want to burn data to the CD, create a new image with the additional data (again, a new blank image or an image from a folder). Select the Burn Image command again; this time the Burn Disc dialog will say Append instead of Burn. Click the Append button to burn another session (again making sure that the “Leave disc appendable” box is checked).

  4. Repeat this process until the disc is full or until you no longer want to burn further sessions to it. (If the latter is the case, uncheck the “Leave disc appendable” box.)

Note

If this procedure is too much of a hassle, the shareware CD Session Burner (http://www.sentman.com/burner/) provides a nice, neat interface for session burning.

Erasing Rewritable Discs

If you have a Mac with a drive that supports CD-RW or DVD-RW (rewritable) discs, you can use Disk Utility to erase those discs for reuse. To do so, insert a rewritable disc, select the disc from the list of volumes on the left, switch to the Erase tab, and then click the Erase button.

Advanced Disk Image Creation Using DropDMG

If you’re interested in more advanced disk image functionality (or simply the ability to access some of the functionality that existed in OS X 10.2’s Disk Copy), you’ll like the shareware DropDMG (http://www.c-command.com/dropdmg/). Using DropDMG you can create disk images—with encryption, compression, and format options—by simply dragging a folder or volume to the DropDMG icon. DropDMG offers additional image formats unavailable in Disk Utility (including images that will mount under Mac OS 9 and earlier); offers the ability to post-process disk images (further compress them, for example, for posting online); and can limit images to a user-definable size (e.g., if the limit is set to 1MB, a 4MB folder will automatically be split over four 1MB images). As a nice touch, you can also make your disk images auto-open when mounted (by default, users have to open disk images manually after mounting them). You can even use DropDMG to create an Internet-enabled disk image (discussed in Chapter 9). If you use disk images a lot, DropDMG is well worth the small share- ware fee.

Creating a Bootable Mac OS X CD Using BootCD

One thing you can’t do using Disk Utility (or most other CD or disk image utilities) is create a CD that contains a bootable copy of Mac OS X. Such a disc, filled with your favorite utilities, would be an excellent “emergency CD” that you could use to boot up your computer in the event of major problems. The good news is that the freeware utility BootCD (http://www.charlessoft.com/) can actually create a bootable disk image—using the copy of Mac OS X you have installed on your computer—which you can then burn to CD using Disk Utility. If you’re in the market for such a bootable CD, the BootCD documentation provides excellent step-by-step instructions. (Be sure to read the section about how to boot your computer using the new CD!)

Note

At the time of this writing, BootCD isn’t yet compatible with Mac OS X 10.3. However, the developer claims to be working on a compatible version; it may even be available by the time you read this.

Alternatives for Burning CDs and DVDs

If you burn a lot of CDs, and/or have specialized CD/DVD-burning needs, you might want to consider a dedicated CD/DVD-burning utility such as DiscBlaze (http://www.radicalbreeze.com/blaze/index.html), Burnz (http://www.thinkertons.com/burnz_features.htm), Discribe (http://www.charismac.com/Products/Discribe/), or Toast (http://www.roxio.com/en/products/toast/). All of these utilities do everything that Mac OS X can do via Disc Burner and Disk Utility, but in a single package. (In OS X, you can do some things in the Finder, but other things require Disk Utility.)

DiscBlaze and Burnz are both inexpensive (less than $20) and offer a few more disc formats as well as the ability to easily burn multi-session and multi-format discs. They support any CD/DVD burners supported by Mac OS X itself.

Toast and Discribe are more expensive but offer additional CD formats (such as VideoCD, XA, UDF, mixed mode, and CD Extra), simpler multi-session burning, Disc-At-Once and Track-At- Once burning (for creating professional audio CDs), CD copying, digital audio extraction, support for BURN-Proof drives, and disk image creation. In addition, both Toast and Discribe support far more CD and DVD drives than Mac OS X/Disk Utility/Disc Burner. Toast costs a bit more than Discribe, but it also includes additional applications for creating photo albums, working with MP3 files, and recording audio from your Mac’s audio inputs to CD.

All of these utilities have interfaces that, though different from each other, are extremely easy to use. If you do a lot of CD or DVD burning, and especially if you need to burn in a format other than MP3, audio CD, or simple hybrid data, I highly recommend that you give one or more of these utilities a try.

Grab (and Screenshots in General)

If you’re a longtime Mac user, you’re familiar with the keyboard combination shift+command+3 to take a picture of the screen (a screenshot). This still works in Mac OS X, as well as a plethora of other keyboard combinations.

Tip

You can combine Mac OS X’s zoom feature (in the Seeing tab of Universal Access preferences) together with any of the procedures listed below to take close-up pictures of any on-screen item.

Screenshots via the Keyboard

You can use the following keyboard combinations to take various types of screenshots in Mac OS X. The resulting screenshot will be saved, in PDF format, to the Desktop.

  • command+shift+3: screenshot of the entire screen. If you have multiple displays connected, all screens will be included.

  • command+shift+4: screenshot of part of the screen. The cursor will change to a crosshair/ marquee, which you use to select the area of the screen you want to capture. When you release the mouse button, the screenshot will be taken. If you want to cancel the screenshot, press the escape key before releasing the mouse.

  • command+shift+4, followed by the space bar: screenshot of any item on the screen. The cursor will change to a camera icon; as you move the camera around the screen, whatever item is directly under it will become highlighted. When you click the mouse button, the screenshot will include only the highlighted area. This is a great way to take a screenshot of a particular window, the menu bar, the Dock, the Desktop (even behind windows), or any Dock or Finder icon.

Tip

Pressing the control key simultaneously with any of these keyboard combinations will cause the screenshot to be saved to the clipboard instead of to a file. You can then paste it into any graphics-capable application. Note that if you have multiple monitors/screens, only the main screen—the one with the menu bar—will be copied to the clipboard.

Screenshots in a Format Other Than PDF

By default, screenshots in Mac OS X are saved as a PDF file. In earlier versions of Mac OS X you could use a utility such as TinkerTool to change this format; unfortunately that’s no longer possible as of OS X 10.2 or later. You can get around this limitation using a third-party utility, as I discuss later in this section, but there’s a two-step way to do it using Preview.

  1. Take a screenshot in Mac OS X, but save it to the clipboard instead of to a file (by holding down the control key as you press the appropriate keyboard combination, as described in the previous section).

  2. Switch to Preview, and then choose File Ø New From Clipboard. Preview will show the screenshot in a new Preview document.

  3. Choose File Ø Export… to save the screenshot in any format you like. (You can also choose to print the screenshot or save it as a PDF using a Quartz Filter, as discussed in Chapter 12.)

You could also open the standard PDF screenshot file in Preview and then export it to a different format, but the above procedure saves you a couple of steps and an extra file.

Screenshots Using Terminal

You can take screenshots via Terminal using the screencapture command, which works identically to the various keyboard combinations. Type screencapture <RETURN> to see a list of options and the correct syntax for the command. (By selecting interactive mode, the space bar and escape keys function exactly as they do when calling a screenshot from the keyboard.) One advantage of this command is that it can be called from any script that can be run from Terminal.

Screenshots Using Grab

The Grab utility is a bit more limited than the various keyboard screenshot commands in that you can’t take a picture of individual items. However, you can still use the marquee to select an area for a screenshot in Grab, and Grab has a couple of advantages of its own. First and foremost, it allows you to take timed screenshots via Capture Ø Timed Screen—when you click the Start Timer button you have 10 seconds to prepare the screen for the screenshot. This is the only way to take a screenshot of a menu without using third-party software. Second, when you take a screenshot using Grab, it isn’t automatically saved to the Desktop or the clipboard. Instead, a new window is opened in Grab with the contents of the screenshot. You can choose to copy the screenshot to the clipboard, save it to a file (wherever you like), or close the window and discard it. In other words, you get to inspect the screenshot and decide what to do with it immediately. Finally, screenshots taken using Grab are saved as TIFF files rather than PDF.

Via Grab’s preferences dialog, you can also choose to make the cursor visible (it’s invisible in screenshots taken using the keyboard), as well as choose which of the Mac OS X cursors is used (arrow, text, “spinning wheel,” etc.). Finally, if you choose Edit Ø Inspector, an Image Inspector window opens that tells you the size and bit depth of each screenshot you take using Grab.

Third-Party Screenshots: Snapz Pro X

Although OS X’s built-in keyboard commands and Grab utility provide a good deal of screenshot functionality, if you take a lot of screenshots you’ll want an industrial-strength solution. Snapz Pro X (http://www.ambrosiasw.com/utilities/snapzprox/) is the OS X version of the longtime king of Mac OS screenshot utilities. Using Snapz Pro X you can take a picture of the screen, any object— or multiple objects—on the screen, including menus, or any selected part of the screen. When "snap- ping" a selected part of the screen, you can resize and move the selection to fine-tune it. You can even view a preview of your screenshot before it’s taken.

In addition to its standard screenshot capabilities, Snapz Pro X also offers many more options than the standard Mac OS X functionality (Figure 7.15). You can choose the graphics format in which screenshots will be saved, and you can decide where they’ll be saved. (They can also be copied to the clipboard or printed immediately.) Other options include borders, scaling, watermarks, and color depth. Even more impressive, the Movie Capture version of Snapz Pro X can record full-motion, high quality video of your screen—the entire screen, a selected portion, or the area around your mouse. (In case you’re interested, all of the screenshots in this book were taken using Snapz Pro X.)

Figure 7.15: Snapz Pro X offers more options than Mac OS X’s own screenshot functionality.

iDisk Utility

The little-known but extremely useful iDisk Utility isn’t installed by Mac OS X; like the Mac Slides Publisher application, it’s available only to members of Apple’s .Mac service. (If you’re a .Mac subscriber, log in to your account at http://www.mac.com/ and go to the .Mac Downloads area.) iDisk Utility provides four tools for working with iDisks.

Open Public Folder Allows you to quickly access another user’s iDisk Public folder by typing in the user’s member name. (If the Public folder is password-protected, you’ll be asked for the appropriate password.)

Public Folder Access Allows you to change the privileges other users have when accessing your own Public folder (Read-Only vs. Read-Write), and allows you to password-protect your Public folder. These options are exactly the same as the Your Public Folder options available from the iDisk tab of .Mac preferences.

Open iDisk Allows you to access your own iDisk (by default it uses the member name and password entered into the .Mac tab of the .Mac pane of System Preferences) or another member’s iDisk (provided you have the correct member name and password). I talk about other ways to access iDisks in Chapter 11.

iDisk Storage Shows the capacity of your iDisk as well as how much of that capacity is currently being used. (It also provides you with a Buy More button that takes you to Apple’s website to buy more space.) These are the same data available from the iDisk Storage section of the iDisk tab of .Mac preferences.

Installer

The Installer utility, as discussed in Chapter 4, provides a common interface for developers (including Apple) to use for installing software packages. If an application or OS update is provided in .pkg or .mpkg format, it will be installed using the Installer utility.

Key Caps (10.2 and Earlier) and Keyboard Viewer (10.3 and Later)

Have you ever wanted to type a nonstandard character, such as the trademark symbol (™), the copyright symbol (©), or the ¿ used when writing questions in Spanish? These two utilities let you figure out such mysteries. Which tool you use, and how you access it, depends on which version of Mac OS X you’re running.

Under OS X 10.2 and earlier, you use the Key Caps utility, located in the Utilities folder. When you launch Key Caps, it provides you with a graphical keyboard that mirrors the current keyboard attached to your Mac (or your PowerBook or iBook keyboard). If you press a key on your keyboard, the corresponding key will be highlighted on the Key Caps keyboard (and typed in the text window). However, if you press any of the text modifier keys (shift, option, or shift+option), the Key Caps keyboard will change to reflect the characters that are possible via those modifier keys (Figure 7.16). For example, if you open Key Caps and choose almost any standard font from the Font menu, you can see that ™ is typed by pressing option+2, © is accessed via option+G, and you can get ¿ by pressing shift+option+? What’s more, to save you the trouble of retyping special characters in another application, you can type them in Key Caps, copy them from the Key Caps text field, and then paste them in any other application.

Figure 7.16: Using Key Caps in OS X 10.2 (top) and Keyboard Viewer in OS X 10.3 (bottom) to view characters in the current font that are accessible via the option key

If you’re running OS X 10.3, Key Caps is gone, replaced by the new Keyboard Viewer. However, rather than being a separate utility, Apple has hidden Keyboard Viewer in an unexpected location: the Input Menu. (OK, maybe it’s not really that unexpected, considering that Keyboard Viewer is indeed a text-input-related feature; however, how to enable the Input Menu isn’t entirely obvious.) To enable the Input Menu, open the International pane of System Preferences, and then switch to the Input Menu tab. Make sure the Keyboard Viewer palette is enabled. Keyboard Viewer will now appear in the Input Menu, which shows up in the menu bar as the flag of the current keyboard layout.

Once the Keyboard Viewer window (technically a palette, since it floats above other windows) is visible, it works much like Key Caps, but with two main differences. First, since Keyboard Viewer is a palette, it has no menu bar, so the Font menu is provided via a pop-up menu within the palette. Second, and more important, whereas Key Caps has a text field, and “typing” characters on the keyboard (by clicking the onscreen keys with the mouse or pressing the keys on your actual keyboard) inputs them into that field, Keyboard Viewer doesn’t have such a text field. If you “type” characters in Keyboard Viewer, they will be input into whatever the frontmost/active application is.

Tip

If you find the Key Caps and/or Keyboard Viewer windows too small and difficult to read, click the maximize (green circle) button on either to increase their size; their keyboards will be scaled to fit the bigger windows.

Keep in mind that whichever of these two utilities you use, the current layout and key combinations are applicable only for the currently selected font. In other words, if you’re using Times New Roman in your word processor, make sure you select the Times New Roman font from the Font menu in Key Caps, or the Font pop-up menu in Keyboard Viewer, before using it to find a particular character.

Tip

If you’re using OS X 10.3, and have a copy of Key Caps sitting around, it still works great under Panther.

Alternatives to Key Caps: CharView, PopChar X, and Apple’s Character Palette

Although Key Caps and Keyboard Viewer are extremely helpful, they still require you to figure out which key combination produces the desired character—often via the tedious process of pressing various combinations until the right character appears on the on-screen keyboard—and then to either type that combination or copy and paste the character into another application. The excellent share- ware utilities CharView (http://www.alxsoft.com/mac/charview.html) and PopChar X (http://www.macility.com/products/popcharx/index.html) both provide pop-up windows, accessible from the menu bar, that show all the possible characters in a chosen font. You can click a character to have it copied to the clipboard, or even have it typed in the active application.

Alternatively, if you’ve enabled the Character Palette in the Input Menu tab of International preferences (in the same place you enabled Keyboard Viewer), the Input Menu will also include a new Character Palette that, when active, floats above other applications. (You can also access the Character Palette from within some applications by choosing Edit Ø Special Characters…) You can input any character from any font into the frontmost/active application by simply double-clicking the character in this palette. (I talked about Character Palette in Chapter 2 when I discussed the Input Menu tab of International preferences.)

Keychain Access

Keychain Access lets you edit, manage, and control your Mac OS X Keychain and any passwords or notes stored in that Keychain. If you have no idea what your Keychain is, you’re not alone—this is another one of those underused and even less understood parts of OS X. I’ll tell you all about it in Chapter 13.

NetInfo Manager

NetInfo Manager lets you edit and manage NetInfo databases. I covered NetInfo databases and Net- Info Manager in depth in Chapter 1, and you’ll actually work more with both of them in various places throughout this book.

Network Utility

Network Utility is a fairly comprehensive application that allows you to monitor many facets of network traffic and Internet connectivity: Ethernet and AirPort interface information, network traffic, and AppleTalk connectivity, to name a few. You can even use it to perform network tests and probes such as lookups, traceroutes, and port scans. The Ping tab is often useful for verifying network connections: enter a known site or server and click Ping; if you get a response, you have network/Internet connectivity with that computer. Since Network Utility’s functions are mostly useful for troubleshooting, I won’t cover them in detail in this book.

Printer Setup Utility

Printer Setup Utility is the center of printing in Mac OS X 10.3 and later (which is why it was, perhaps more accurately, called Print Center in OS X 10.2). It’s where you manage printers and print jobs. I’ll talk more about Print Center in Chapter 13.

System Profiler

System Profiler (called Apple System Profiler in OS X 10.2 and earlier) provides comprehensive information about your Mac. The information available via System Profiler is divided into four general areas. (In the summary below, I’m assuming you’ve enabled the Extended view, accessible via the View menu.)

Hardware Clicking the main Hardware item provides information about your Mac model and its main hardware specs, as well as your Mac’s serial number. However, clicking the disclosure triangle next to Hardware provides additional details about various types of hardware: memory (RAM), PCI/AGP expansion cards, internal drives, external devices, etc. If there’s hardware on, in, or connected to your Mac, System Profiler will provide you with information about it. (If you’re having problems with a particular device not working, check here to verify that your Mac even “sees” it.)

Software Selecting the main Software item shows you an overview of your system software: the version of Mac OS X installed, the boot volume, the current user, etc. But just as the Hardware item provides subcategories of hardware information, information about the Software on your Mac is split into several groups. In each case, you can see the version number of a particular software item, the last time it was modified, its official “Get Info” string, and where it’s located on your drive.

The Applications item provides details on every non-Classic application installed on your computer. This tab can be an extremely useful “quick reference guide” when you need to check on application versions. The Frameworks subsection provides information on installed frameworks (function-specific portions of the OS). Finally, the Extensions item provides information on installed kernel extensions. The Get Info String column can sometimes be used to identify which kernel extensions were provided by Apple and which were not.

Note

Under OS X 10.1, the Extensions tab provided very specific information about which kernel extensions were provided by Apple and which were not. Strangely, Apple removed this functionality under OS X 10.2 and later.

Network The Network item shows all active network port configurations, and provides information about each, including IP addresses and, if applicable, MAC addresses. (For more information about network port configurations, see Chapter 9.)

Logs This item provides quick access to the console and system logs. (See “Console,” earlier in this chapter, for more details.)

Note

Under OS X 10.2, System Profiler uses six categories to organize data: System Profile, Devices and Volumes, Frameworks, Extensions, Applications, and Logs.

You may find that a developer requests an Apple System Profiler report if you request technical support for their products. You can save such a report (in several formats) via System Profiler’s File menu (via the Export submenu). Alternatively, you can copy the text from any information panel and paste it into an e-mail or other text field. If you want to view a report you had previously saved, you can do that, as well.

Tip

You can actually access System Profiler from the Apple Menu’s About This Mac window. Just click the More Info…, button and System Profiler will launch. (If you just need to get the serial number of your Mac, click the OS X version number (twice) in the About This Mac window.)

Running System Profiler from Terminal

In addition to using System Profiler via the application’s own interface, if you’re running OS X 10.3 or later, you can also use it in a more limited manner directly from Terminal. Type system_profiler > PathToFile <RETURN>, where PathToFile is the path to, and name of, the file to which you want the Apple System Profiler report saved. For example, system_profiler > ~/Desktop/Report.txt <RETURN> will save the report to a file called Report.txt on the Desktop.

Terminal

Terminal provides an interface for Mac OS X’s command-line interface. I’ve already talked about Terminal many times in the book, and you’ve probably used it several times as you followed along with some of the examples I’ve provided. I’ll talk more about Terminal and its various settings and functionality in Chapter 15.

X11

X11 is Apple’s X Window System implementation for Mac OS X, which allows developers to port X Window–based applications to OS X fairly easily. I’ll talk more about X11 in Chapter 15, but for Apple’s official info, visit http://www.apple.com/macosx/features/x11/.


Basic Application Troubleshooting

Unfortunately, many things can go wrong with applications. Although I generally shy away from troubleshooting information in this book, I want to briefly talk about two of the most common application problems: freezes and corrupt preference files.

Dealing with Application Freezes

If an application crashes, it will usually quit automatically; you can generally just relaunch it and get back to work. However, sometimes the offending application won’t quit—it will just sit there, unresponsive, often displaying the dreaded “spinning beachball of death.” In this scenario, the only way to get the application to quit is using a force quit. Whereas a standard quit (one you, as the user, initiate via ApplicationName Ø Quit, or by pressing command+Q) allows you to save documents and allows the OS to elegantly stop the application, a force quit simply kills the application on the spot. You don’t get to save any open documents, and any preferences you may have set during that session may not get saved. A force quit isn’t graceful, but if it’s the only way to quit a misbehaving app, it’s quite useful. You can force quit an application using one of three methods.

Force quit using the Force Quit Applications window If you select Force Quit… from the Apple Menu (or press command+option+escape), you’re presented with the Force Quit Applications window (Figure 7.17). By selecting an application from the list and then clicking Force Quit, the application will be quit immediately. (You’ll get a dialog asking if you’re sure you want to force it to quit.) If an application is frozen—it hasn’t crashed/quit, but it won’t respond—it will generally be listed with the text “Not responding” after its name in the Force Quit Applications window. (In OS X 10.2, the offending application will instead be listed in red type.)

You can quickly exit the Force Quit Applications window by pressing the escape key, regardless of whether or not you’ve actually used it to force quit an application.

Figure 7.17: The Force Quit Applications window
Note

If you select the Finder in the Force Quit Applications window—it will be listed at the bottom of the list, instead of in alphabetical order, as other applications are—the Force Quit button will instead read Relaunch. Since Mac OS X considers the Finder to be essential, you can’t just force quit it; instead, OS X will force it to relaunch.

Tip

If you want to immediately force quit the frontmost/active application, you can save a couple of steps by holding the shift key down: pressing shift+command+option+escape will immediately force it to quit. Similarly, if you hold the shift key down as you access the Apple Menu, the Force Quit… item will change to Force Quit Active Application Name; selecting this item will immediately force the named application to quit. By using one of these procedures, you avoid having to open the Force Quit Applications window. The shift+command+option+escape combination is especially helpful when the current (frozen) application is a full-screen app that doesn’t allow you to access the Apple Menu!

Force quit from the Dock I mentioned in the previous chapter that you can quit an application from its Dock menu. (Control/right-click the application’s Dock icon to access its Dock menu.)

If you press the option key while accessing an app’s Dock menu, Quit changes to Force Quit. Selecting this option is identical to using the Force Quit window. Note that if an application is frozen, sometimes you won’t even need to hold down the option key; Force Quit may appear in the application’s Dock menu automatically (and the Dock menu will most likely include an item that reads Application not responding). However, keep in mind that sometimes an application that appears to be hung or frozen may simply be “busy”; for example, I frequently see such behavior when my Web browser is busy rendering a complex website.

Force quit using Activity Monitor If you launch the Activity Monitor utility (/Applications/Utilities/Activity Monitor, Process Viewer in OS X 10.2 and earlier), you get a listing of all running processes (shown earlier in this chapter in Figure 7.13). To quit an application, select it from the list of running processes, and then choose Process Ø Quit (or click the Quit item in the toolbar). You’ll be presented with a dialog asking if you want to Quit or Force Quit the application; in this scenario, you’d want to force quit.

You’ll notice that Activity Monitor lists many more processes than the Force Quit Applications window; the latter lists only standard applications that are visible in the Dock whereas Activity Monitor lists all running processes, including background applications and system-level processes. To see only applications running in your own user account—which is where a misbehaving application is likely to be running—choose My Processes from the Show pop-up menu. You can also use the Filter field to quickly find a process if you know its name; however, frozen processes will often be listed in red, making them easier to find.

Note

There’s actually a fourth way to force an application or process to quit: using the top command in Terminal. However, top doesn’t really offer any advantages over the three methods discussed here unless you’re logging in to your Mac remotely. I’ll talk about using top in such circumstances in Chapter 11 when I cover Remote Login.

One caveat to force quitting Classic applications: because of the way memory protection does and doesn’t work inside the Classic environment, force quitting a Classic application will usually quit the entire Classic environment and all other Classic applications.

Dealing with Bad Preference Files

A corrupt preference file can often cause its corresponding application to misbehave; this is actually one of the most common causes of application problems in OS X. Why a preference file goes bad— a previous application crash, hard drive problems, etc.—isn’t as important as what to do when it happens.

As I mentioned in Chapter 2, preference files are stored in /Library/Preferences (for systemwide preferences) and ~/Library/Preferences (for user-level preferences), and they generally have the name of the application in the filename; for example, com.apple.TextEdit.plist is the preference file for TextEdit. If you’re having continual problems with a particular application, its preference file should be the primary suspect. First, quit the application. Then locate its preference file in the Preferences folder—you can use the Search field from a Finder window toolbar, as described in Chapter 5, to find the file quickly—and drag that file to the Desktop. Then launch the application. If the problems are gone, you know the preference file you moved to the Desktop was the culprit, so you can delete it permanently; a new one was created when you launched the application. If the problems still exist, the preference file wasn’t the cause; you can quit the application and replace the new preference file with the original one.

Note

Note that only an admin user can delete preference files in the main /Library folder.


Text Testimonials: Working with Text in OS X

OK, so this section isn’t really about applications, per se. However, much of the application-related work you do on your computer (e-mail, word processing, text editing, etc.) is text-related, and Mac OS X offers some helpful and unique ways to deal with text, so I decided that the topic deserved some mention of its own. I’ll start by talking about tips that work only in Cocoa and some Carbon applications, and then I’ll move on to solutions that work in all applications.

Note

Mac OS X’s Text Services engine is actually quite impressive. Visit http://www.codepoetry.net/archives/2003/10/24/ panthers_major_text_services_upgrade.php for a good summary of OS X 10.3’s text features.

Cocoa/Carbon Text Tips

Earlier in the chapter, when I talked about the various types of applications in Mac OS X, I mentioned that Cocoa applications could take advantage of all of the special application goodies in Mac OS X. I also mentioned that some Carbon applications, if the developer chose to do so, can also take advantage of these features. Here are some of the features I was talking about; Cocoa applications, such as iChat, Mail, TextEdit, and Stickies, as well as third-party Cocoa applications, can take full advantage of them; Carbon applications can use them as well, as long as their developers have included the necessary support.

Copy and Paste Formatting

If you’ve used Microsoft Word for word processing, you’re probably familiar with its ability to copy and paste formatting, which can be very useful when you want one block of text to look like another. Cocoa applications all have this ability built in, and you can even copy text formatting from one Cocoa application and paste that formatting onto text in another. In most Cocoa applications, this feature is located at Format Ø Font Ø Copy/Paste Style.

Cocoa Keyboard Shortcuts

Applications generally have their own keyboard shortcuts for menu items and other frequently used commands; however, all Cocoa applications share a set of keyboard shortcuts that are used when working with text. The list of commands is much too long to include here, but if you open Terminal and type bindkey <RETURN> you’ll see the entire list. Ignore the quotation marks around a key combination; the ^ character stands for the control key. For example, pressing control+T will transpose the characters to the left and right of the cursor.

Tip

If you’re a longtime emacs user, you’ll find that many emacs keyboard shortcuts work in OS X applications that are Text Services–aware.

The Font Palette

Accessible from any Cocoa application (and some Carbon apps) via Format Ø Fonts Ø Show Fonts (or by pressing command+T), OS X’s Font palette (called the Fonts Panel in OS X 10.2) is incredibly useful. If you resize it to its smallest size, you get the most basic font dialog: pop-up menus for font family, typeface style, and size. Resize it to its largest size, and you get scrolling panels for each item, along with a font size slider and a Collections panel. (You can create collections of fonts—those that you tend to use together—for quick access.)

In addition, the Action pop-up menu (which looks just like the Finder’s Action menu toolbar item) provides access to a number of advanced features. If you select Show Preview, you get a small preview area that shows you the font, font style, and font size you’ve selected, along with a preview of your selection. Selecting Show Effects provides additional text effects, such as strikethrough, underline, color, and (customizable) shadow. The Characters… item opens the Character Palette, described in Chapter 2 and earlier in this chapter, and the Color… item opens OS X’s Colors palette. The Typography… item provides you with access to special typographic features, provided the selected font has any. Finally, the Manage Fonts… item opens the Font Book application.

Tip

You can change the preview text by double-clicking in the preview panel and typing your own text. If the preview text is too big to fit in the current preview area, click and hold the little “dimple” just below the preview area; you can drag downward (or upward) to resize that area.

What makes the Font palette especially useful is that it’s a floating window, meaning you can keep it open all the time; when you want to use a different font, you just select it from the panel. (If you want to apply a font to a certain section of text, highlight the text and then select the font.)

You can also customize other parts of the Font palette. By selecting Edit Sizes… from the Action pop-up, you can add or remove font sizes from the default list that appears in the palette, and you can choose to view font sizes as a list, a slider, or both. To create your own collection of fonts, click the + button; you can then drag fonts to the new collection. If you select an existing collection, you can rename it by double-clicking it or remove it using the - button. You can also take advantage of the Favorites collection: Add a favorite font style by choosing "Add to Favorites" from the Extras… pop-up. To remove a font from a collection, select it in the appropriate collection view and drag it out of the Font palette.

Spell-Check

All Cocoa applications can use Mac OS X’s built-in spell checker, available from the Edit menu. Some, such as TextEdit, even allow you to enable on-the-fly spell-checking—if a word is misspelled, it will be underlined in red within the document. You can control/right-click a misspelled word to choose the correct spelling from a list of suggestions or choose to ignore the word or to add it to Mac OS X’s dictionary so that it won’t be flagged in the future.

Word Suggestions

Related to spelling, if you’re having trouble finding a word, Mac OS X can actually suggest one. Type the first few letters of a word in any Text Services–aware application, and then press option+escape (or, in some apps, F5); a list of possible word completions will appear (Figure 7.18). Double-click the desired word, or use the arrow keys to scroll to it and press return, to have it inserted into your document.

Find and Replace

The Find dialog in Cocoa applications allows you find text strings and to replace found text with other text. This kind of functionality is most likely old hat to many users, as it’s been around in Word and other word processors for years. However, one nice feature about OS X’s Cocoa Find dialog is that it has a good memory: If you use the Find dialog to search for text in a Cocoa application, Mac OS X remembers the text for which you were searching. The next time you use the Find command— in any Cocoa application—your previous search term will be entered by default. This can be very useful when searching for similar text across several applications.

Tip

One stumbling block in Find/Replace dialogs has always been how to find (or use in replacement text) characters such as returns and tabs—since the return key usually initiates the find, and the tab key usually moves between fields in the Find dialog. Here’s the solution: to insert a return into a text field, press option+return; to insert a tab, press option+tab.

Figure 7.18: Mac OS X’s word suggestion feature

Services

Services, available from Application Name Ø Services, provide some of the coolest features of Cocoa applications, but (seeing a pattern here?) most people don’t even realize they exist. Or, because the Services menu item always exists, but only works in Cocoa or certain Carbon applications, many people think that Services are “broken” or don’t work properly.

What are Services? They’re one of those things that are harder to explain than they are to use. (That’s my disclaimer, by the way, if the next few sentences are confusing.) Basically, Mac OS X allows applications, and the OS as a whole, to provide services to other applications from within those applications. For example, you can select text in one application and then send that text to another application to work with it. In some cases you can even use the functionality of the other application without leaving the one in which you’re currently working.

Perhaps an example will make this a bit clearer. In writing this book, I used a database program called DEVONthink to keep track of notes and tidbits of information that I might include in the book. I also spent a good deal of time reading the ReadMe files that come with shareware, freeware, and commercial software. In doing so, I often found useful information about an application that I wanted to remember for later. I could have selected the text from within TextEdit, copied it, switched to DEVONthink, created a new note, and then pasted the text into the note. However, with Services, I could simply highlight the text in TextEdit and then, from within TextEdit, use the DEVONthink service to automatically transfer the text to a new DEVONthink note (Figure 7.19—my Services menu will probably look different from yours, depending on what applications you have installed). What took five steps without Services took two steps with them. I also used this technique quite frequently when browsing Apple’s online documentation; many Web browsers also support Services, so you can select text in a browser window and then use Services to send the text to TextEdit or any other application that provides a Service.

Tip

Many Services are also accessible via keyboard shortcuts. These shortcuts are generally listed next to the Service name in the Services submenu.

Note

Services aren’t limited to text, by any means; in fact, they’re also supported by the Finder for working with files and folders. However, the vast majority of services are used for working with text, so I’ve included the discussion of them here.

Figure 7.19: Using Services to transfer text from TextEdit to a new note in DEVONthink
Summarizing Text

One of the most interesting Services provided by Mac OS X is the Summarize Service. Select a block of text in a supported application, and then choose Application Name Ø Services Ø Summarize. A new Summary window will open that automatically summarizes the selected text (Figure 7.20). Using the Summary Size slider, you can choose how compact you want the summary to be (100 percent gives you the original text, 1 percent—which is only really 1 percent if you have a lot of text—gives you the smallest summary the Summarize Service thinks can be used and still be meaningful.

Figure 7.20: Using the Summarize Service, it’s possible to make the Gettysburg Address even shorter.
Tip

If the Summarize Service sounds useful to you, but you spend most of your time working in applications that don’t take advantage of Services, the contextual menu plug-in Abstracter (http://www.mercury-soft.com/) provides similar functionality to all applications.

Installing New Services

Many applications install their own Services when the application itself is installed. In addition, every time you log in, OS X scans the various Applications folders for applications that provide Services within their application packages—this is how you got all those Services that you don’t remember installing. However, some excellent third-party Services aren’t provided by or with applications— they’re simply Services plug-ins that work on their own, and their only interface is the Services submenu. (You can find some of these by doing a search for “service” at VersionTracker.com or MacUpdate.com.) These Services are installed much like other system add-ons: place them in ~/Library/Services (for use by the only current user) or /Library/Services (for use by all users). After installing a new Service, you need to log out and then back in to be able to use it.

Note

In some versions of Mac OS X, having more than 70 or so Services installed—via applications or Services plug-ins—may prevent the Services submenu from working at all. Mac OS X 10.3 and later seem to have fixed this bug, but I’ve still seen some reports of it.

Some examples of useful third-party, stand-alone Services are WordService (http://www.devontechnologies.com/download.php), which provides a number of text formatting, conversion, and statistical functions; CalcService (from the same developer), which allows you to type a numerical expression and have it be replaced by the result of that expression; Terminal Services (http://homepage.mac.com/stas/terminalservices.html), which allows you to select text and have it executed as a command in Terminal; NetService (http://www.dekorte.com/Software/OSX/NetService/), which allows you to perform a number of Internet-based searches—Web, map, Usenet, dictionary, Yellow Pages, and even eBay auctions—on highlighted text; and Translation Service (http://www.kavasoft.com/TranslationService/index.html), which lets you translate text to and from a number of languages. Finally, the shareware AtYourService (http://www.selznick.com/) provides a number of Web-, translation-, and developerrelated Services, but it also lets you create custom text-related Services.

Removing Services

If you find that your Services submenu is a mess, you have a few options. First, you can manually remove unused stand-alone Services from the Services folders mentioned above. Second, if a particular Service is provided by an application itself, removing that application from any of the Applications folders will prevent its Services from appearing in the Services submenu. Finally, the third-party preference pane Service Menu Manager (http://www.blacktree.com/apps/index.html; click the "Older Stuff" link) lets you disable (and enable, if necessary) Services provided by applications, change Services’ keyboard shortcuts, and even reorganize the Services menu itself. However, I haven’t yet tested it under OS X 10.3.

Regardless of which method you use, you need to log out and then back in before the Services menu will be updated.

Other Text Tips

If your favorite text-oriented application isn’t a Cocoa app or a compatible Carbon app, don’t worry; there are still a number of great utilities out there to help you work faster and more efficiently. (All of these tips work in Cocoa applications, as well.)

Using Multiple Clipboards

The Mac OS has long had a universal clipboard—copy or cut text (or graphics) from one application or document, and you can then paste it into any other application or document. The problem is that each time you cut or copy, you lose the previous contents of the clipboard, as they’re replaced by the most recently cut/copied content.

If you’ve ever been frustrated by this limitation, a number of excellent utilities for Mac OS X provide multiple clipboards. Three of the best are the commercial You Control (http://www.yousoftware.com/, a comprehensive menu utility that incorporates the PTHPasteboard utility I recommended in the First Edition of this book), the shareware CopyPaste-X (http://www.copypaste-x.com/) and the shareware Keyboard Maestro (http://www.keyboardmaestro.com/). You can’t go wrong with any of these utilities; however, they each take a different approach. You Control is the one I use most frequently, mainly because I find it to be the simplest to use (although it has some great advanced features if you want to go beyond the basics). It keeps track of a user-defined number of recently used clipboard contents (it refers to them as buffers) and makes them accessible via a system-wide menu. You can paste the contents of a recent clipboard into any document by selecting the appropriate buffer from the menu (Figure 7.21). Before pasting the contents of a buffer, you can see what format those contents are in, from what application they were copied, and the date/time of that copy. If the contents of a particular pasteboard are styled text, you can even decide whether to paste them as unformatted text, rich text, or even as a PICT file.

Having Your Computer Type for You

If you’re like me, there are lots of things you type over and over again, such as the date, your name and address, your phone number, an e-mail signature (or several), and—for those of us who answer a lot of repetitive questions—even “stock” e-mail responses. Here are a few ways you can automate such typing.

Text Completion/Shortcuts

If you’re the type of person who can remember key combinations and abbreviations, you’ll love the shareware TypeIt4Me (http://www.typeit4me.com/). Once installed, you can set up shortcuts to frequently typed text that can be invoked from within any text field or document and are triggered by your choice of keyboard commands. For example, the default TypeIt4Me trigger is the space bar; you can set up a shortcut whereby the letters addy stand for your home address. As you’re typing in a document, type addy followed by a space, and TypeIt4Me automatically replaces addy with your full address as you keep merrily typing along. TypeIt4Me also includes several stock shortcuts to quickly enter the date, the time, or both. The advantage of TypeIt4Me over other utilities is that if you can remember all of your shortcuts, it’s amazingly fast, and you never have to take your hands off the keyboard. The disadvantage is that you have to remember which combination(s) of characters are shortcuts for what text.

Figure 7.21: You Control’s multiple clipboards
“Type” Frequently Used Text

If, like me, you tend to forget such things, you’ll appreciate what I call text typers. These utilities store various bits of text—words, sentences, or even multiple paragraphs—and type or paste them into a text field or document on your command. This may sound like exactly what TypeIt4Me does, but the difference is that with these utilities you don’t have to remember any shortcuts; you press a key or click a Dock icon, and you get a list of your stored text blurbs to choose from. The process takes a couple more steps, but you don’t have to worry about remembering (or forgetting) the shortcuts.

I mentioned Keyboard Maestro and CopyPaste-X when I talked about multiple clipboards; both allow you to save clipboards permanently, providing you with a quick and easy way to access frequently used text. You simply copy the desired text to Keyboard Maestro or CopyPaste-X; when you want to paste that text into a document, you use a single keyboard shortcut to bring the utility to the front and then select which clipboard you want to paste.

But the text typer I use most often is Typist (http://www.selznick.com/products/typist/ index.htm). Typist resides in the Dock and lets me create any number of text entries (including date/ time templates). When I want to type one of those bits of text into a document I simply control/right-click the Typist icon in the Dock, and a menu of my text bits appears. Selecting one of these items types it into the document. (If you’re a keyboard lover, you can also assign a hotkey to Typist that brings up the list of shortcuts; use the cursor to select one and press return to type it.)

Voice Recognition Software

In addition to the kinds of utilities I just described that you use via the mouse and keyboard, there are software packages allow you to dictate via a microphone and have your voice transcribed into text that can be entered into any application. ViaVoice (http://www-3.ibm.com/software/speech/mac/ index.shtml) and iListen (http://www.macspeech.com/products/iListen.html) are the Mac OS X options available at the time of this writing. I haven’t used either product, but both have received decent reviews.

Taking Advantage of Clippings

The Mac OS has had text clipping files for years, and Mac OS X maintains this functionality. Highlight a block of text in almost any application, and then drag the text to the Desktop or any Finder window to create a text clipping. (The clipping’s name will include the first few words of its contents to help you identify it.) Double-clicking a clipping file opens it in a window that shows its contents; you can copy those contents (via Edit Ø Copy or by pressing command+C) and then paste them into any application. Alternatively, dragging the clipping to a text field or document immediately pastes its contents at the location where you drop it.

Clippings are actually another way you can access frequently typed text. You can create clipping files of such text and then store those clippings in a folder or on the Desktop; you can then drag them into a document whenever you need a certain snippet of text. I personally use XShelf, mentioned in Chapter 5, to store a few frequently used clippings in a floating shelf that’s accessible from within any application.

Tip

The main drawback to clippings is that you can’t easily edit their contents. If you tend to use clippings often and want to be able to edit them and copy them, the shareware application clipEdit (http://www.everydaysoftware.net/clipedit/index.html) allows you to do both, as well as to create new clippings without any dragging.

Write in Ink

In Mac OS X 10.2, Apple added a new feature to the OS called Ink. Using a supported graphics tablet, you can print text on the tablet, and OS X will convert it to text and insert it into the current application. If you draw a picture or sketch using the stylus, Ink will convert it to a graphic and allow you to open it in, or paste it into, any graphics application. You can also select menu items and “press” keyboard shortcuts using the stylus and graphics tablet. You enable/disable Ink via the Ink pane of System Preferences (which appears only if a compatible graphics tablet is connected).

At the time of this writing, Ink supports only a few tablets (mostly ones from Wacom) and has a few glitches when interacting with applications. As a result, it’s not yet widely used. I expect this will change as more and more tablets are supported and as more and more users take advantage of the possibilities Ink provides.

Tip

If you have an Ink-compatible tablet, check out the Ink-aware notebook inkBook (http://www.magesw.com/inkbook/). It lets you "hand write" your notes into an on-screen notebook; your notes remain in your own handwriting but are indexed like normal text, allowing you to search them and even copy and paste their text into other applications.

Cleaning Up Messy Text

You’ve surely been in this situation before: Someone sends you an e-mail with text that you need to use, but it’s full of e-mail quote marks (the > symbol), carriage returns, and unnecessary spaces. Or perhaps you’ve copied text from a Web page or PDF file, and it’s simply a mess. Chances are you spend a good deal of time cleaning up the text, or you just say "forget it" and use it as is. If so, you should definitely give textSOAP (http://www.unmarked.com/) or TextSpresso (http://www.taylordesign.com/) a try.

Both utilities allow you to paste text into their “cleaning” window (or open a text file from within the application) and then apply any number of text cleaning operations (textSOAP calls them cleaners, TextSpresso calls them filters), from removing quote marks, extra spaces, and carriage returns, to find- ing/replacing text strings, to stripping extraneous HTML tags that may have found their way into your text. In addition to cleaning up messy text, both utilities allow you to customize text in myriad ways automatically, using many different preconfigured cleaners/filters. You can also create your own cleaners/filters based on your own needs.

TextSpresso has a unique feature that allows you to batch clean a number of text files at once and includes an amazing number of filters (more than 200!) that perform specific combinations of tasks. For example, a set of HTML-specific filters provide the kinds of cleaning tasks you would be most likely to use on HTML files. It’s also much more customizable than textSOAP. However, I still find myself using textSOAP more often, mainly because of the fact that it can operate as a Service. This means that if I have “dirty” text in TextEdit, Mail, or any other Services-aware application, I can select that text and then choose Application Name Ø Services Ø textSOAP Ø cleaner name and textSOAP will “clean” my text right there in the current application.


Moving On...

Team LiB

Moving On…

I hope by now you’re a more proficient user of OS X applications (especially the ones you didn’t know much about before). But if you still have some older OS 9 applications that you need or want to use, you’re also going to spend a good amount of time using OS X’s Classic environment. In the next chapter I’ll show you how to make the best of that time (and of your Classic apps).


Chapter 8: Clobbering Classic

(Or: If you have to use the Classic environment, how to make the best of it.)

Overview

If OS X is your first experience with a Mac, most, if not all, of your software was made for, or adapted to, Mac OS X. However, if you previously used OS 9 or earlier, you most likely have some software that isn’t OS X–native. Luckily, Apple has provided a way for you to use such software under OS X, called the Classic environment. In this chapter, I’m going to talk about using the Classic environment and Classic applications, as well as give you some tips on how to make using both as painless as possible.

Note

In addition to the information included in this chapter, if you’re just now making the transition to OS X from OS 9 or earlier, or if you use both frequently, I’ve included a comparative discussion of OS X versus OS 9, and tips for working with the two, in the Online Appendix. If you long for some of the features of OS 9 that aren’t a part of OS X, I’ll show you how to get them; if you boot your Mac into both OS 9 and OS X, I’ll show you how to make switching back and forth as smooth as possible.

Note

Unless otherwise noted, all of the tips and procedures in this chapter are for any user level, affect only that individual user, and don’t require Terminal. Because of this, you won’t see the familiar tip table. However, if all users of your Mac are using the same copy of Mac OS 9 for the Classic environment (I’ll talk more about that as the chapter progresses), note that any changes made to that OS 9 System Folder have the potential to affect other users’ experiences in Classic.


A Quick Primer on the Classic Environment

Mac OS X is a Unix-based operating system that offers advanced features such as protected memory, preemptive multitasking, dynamic RAM allocation, full multithreading, symmetrical multiprocessing, and a microkernel architecture. These are features not found in Mac OS 9 (which is why OS X is the “new and improved” Mac OS). If these terms don’t make a lot of sense to you, that’s OK; what’s important is to understand that because of its Unix base, Mac OS X is a completely different operating system than the “Classic” Mac OS.

Although these features are all dramatic steps forward in terms of performance and stability, one consequence is that applications written specifically for Mac OS 9 and earlier (Classic applications) are not compatible with Mac OS X, and those written specifically for OS X (Cocoa applications) don’t run in OS 9.

Note

I talked about the various types of Mac OS applications—Classic, Carbon, and Cocoa—in Chapter 7.

This incompatibility presented a problem for Apple: When Mac OS X was first released, existing Mac users had a lot of Classic Mac OS software that wouldn’t run under OS X. Realizing that people would be extremely reluctant to switch to Mac OS X if it meant having to dump all their existing software and start over (not to mention that such a dramatic change wouldn’t have been much different from switching to Windows!), Apple came up with two solutions. The first was Carbon applications; as I explained in Chapter 7, Classic applications can be Carbonized, which means they can be partially rewritten to work in both OS X and OS 9. The major drawbacks to Carbonizing applications are that (1) they tend to be quite inconsistent in the extent to which they take advantage of Mac OS X features and (2) for an application to be Carbonized, the developer has to undertake the effort (or hand the code over to a third party). For many (if not most) Classic software packages, the developers are unwilling to do so, will not do so immediately, or are no longer even around.

The second solution is the Classic environment. What the Classic environment is is a bit difficult to explain (but I’ll give it a try in a moment). What the Classic environment does, quite simply, is allow you to run Classic applications from within Mac OS X. When the Classic environment is running, you can launch most Classic applications in Mac OS X and they’ll run just as if they were launched in Mac OS 9. In addition, these applications will appear in the Dock just as Mac OS X applications do. If you’re interested in the nitty-gritty behind Classic, the next section will give you a better idea of what’s going on.

Note

I’ll be using a few terms in this chapter that can get confusing, so I want to lay them out here. When I talk about the Classic Mac OS, I’m referring to versions of the Mac OS prior to OS X (usually, OS 9). Classic environment and Classic refer to the Classic environment in OS X. Classic applications are those applications that are/ were written specifically for OS 9 or earlier. Finally, if I mention the Classic System Folder, I’m talking about the copy of Mac OS 9 that’s currently being used by the Classic environment.

Classic Technical Details

From Mac OS X’s point of view, Classic is simply an application (located at /System/Library/ CoreServices/Classic Startup), just like Mail, Safari, and iPhoto. However, instead of being a visible application that shows up in the Dock and has its own menus, Classic runs in the background and provides a hardware abstraction layer, on top of which a full copy of Mac OS 9, located in a Mac OS 9 System Folder on your hard drive, is loaded. Classic applications then run within this copy of Mac OS 9, just as if the computer had booted into OS 9. Almost any application that is compatible with Mac OS 9.1 or later is compatible with Classic. (Classic requires a System Folder containing Mac OS 9.1 or later for OS X 10.1, and a System Folder containing Mac OS 9.2 or later for OS X 10.2 and later.)

Note

A hardware abstraction layer is software that provides and controls access to a hardware device or system. Since you can’t boot into two operating systems at the same time, the Classic environment in Mac OS X provides a hardware abstraction layer, on top of which Mac OS 9 can run. As an example of how this works, when a Classic application accesses the Ethernet port on your Mac, what’s really happening is that the Classic application is accessing the “Ethernet port” of the Classic environment, which is then tunneled through Mac OS X to the actual Ethernet port.

Of course, this means that for Classic to function, a copy of Mac OS 9 must be installed on your Mac. If you install Mac OS X on a Mac that was previously running OS 9, you can use that copy of OS 9 for Classic; if your Mac came with Mac OS X pre-installed, a copy of OS 9 was also preinstalled for use by Classic. (You can actually have more than one copy of OS 9 installed and decide yourself which one to use; I’ll talk a bit about that when I discuss Classic preferences.)

Classic Support and Limitations

Because the Classic environment loads a full version of Mac OS 9, it supports most of the same hardware, protocols, and input/output devices that would be supported if you actually booted into OS 9 on the same computer. However, since all communication between Classic and your computer’s hardware has to go through Mac OS X, there are some limitations. For example, if Mac OS X doesn’t support a port or a type of hardware, neither will Classic, and thus Classic applications running in Classic won’t be able to access that port or hardware. In addition, some types of hardware that are supported by OS X are, for whatever reason, not available to Classic applications at all (e.g., internal modems). Below is a list of things that Classic does and does not support.

Supported

  • USB

  • FireWire

  • Ethernet

  • IDE

  • SCSI

  • PCI or PC expansion cards supported by Mac OS X

  • Built-in audio/sound

  • Built-in video

  • Disk images

  • Built-in ADB ports, but only for the primary keyboard and mouse—and a Classic application crash may require you to restart Classic to regain the use of ADB.

Note

Interestingly enough, the Classic environment can sometimes support hardware that isn’t officially supported by Mac OS X. For example, if a printer manufacturer provides OS 9 drivers for a particular printer but not OS X drivers, you can often print to that printer from within Classic. I talk about how to use this capability to your advantage in Chapter 12.

Unsupported

  • Built-in serial ports

  • Infrared ports

  • LocalTalk

  • Internal floppy drives (however, external USB floppy are supported)

  • PCI or PC expansion cards that aren’t supported by Mac OS X

  • Modem-based applications (AOL, Z-term, and most fax software) can’t access your Mac’s internal modem from within Classic. All network connections, including PPP connections, must be initiated under OS X and then funneled to Classic applications.

  • UFS or NFS file systems

Note

For more of the nitty-gritty details on Classic, check out Apple’s Developer documentation at http://developer.apple.com/documentation/ MacOSX/Conceptual/SystemOverview/InstallIntegrate/chapter_51_ section_5.html .

Classic Caveats

Overall the Classic environment works fairly seamlessly; you simply launch your Classic applications and use them like any OS X application. You’ll notice a few cosmetic differences in features such as menus and Open/Save dialogs—which I’ll talk about shortly—but other than that, a Classic application runs just as it would under OS 9. However, there are a few caveats to using Classic applications in the Classic environment.

First, Classic applications generally run more slowly in Classic than they would if they were running on the same computer booted into Mac OS 9. The reason for this should be clear: In OS X, a Classic application runs on top of OS 9, which runs inside Classic, which in turn runs on top of OS X. These extra layers inevitably slow down the application’s performance. The degree of this performance degradation varies, and seems to be reduced with each new update to Mac OS X, but it’s always there.

Second, the fact that these extra layers exist means more chances for things to go wrong. You’ll probably find that Classic applications are a bit less stable in Classic than they are when they’re run from a computer booted into Mac OS 9.

Third, you may find that some Classic applications, or certain features of Classic applications, either don’t work as well as they do when booted into OS 9 or simply don’t work at all. For example, Classic applications that need to access your Mac’s hardware directly—such as disk utilities—won’t work from within Classic.

Finally, the advanced features provided by Mac OS X—the ones I mentioned at the beginning of this chapter—aren’t available to Classic applications. The Classic environment, as a Mac OS X application, benefits from protected memory and preemptive multitasking, but Classic applications running within the Classic environment don’t. They behave just like applications running in Mac OS 9. For example, if a Mac OS X application crashes, you can generally go right on working in other applications; however, if a Classic application crashes, it will often crash the entire Classic environment (just as a Mac OS 9 application crash would often force you to restart your Mac).

Note

I guess it’s also a caveat—although not one that’s unique to the Classic environment—that if you have Fast User Switching enabled, only one user at a time can have Classic running. I talked more about this restriction in Chapter 1.

Updating Classic System Software

Just as Apple releases updates to Mac OS X, updates to Mac OS 9 are periodically available (although much less frequently nowadays since OS X is the only OS shipping on current Macs). In Mac OS X 10.1, you could use the OS 9 Software Update control panel from within Classic to download and install the latest OS 9 updates. However, Apple removed this functionality starting with Mac OS X 10.2—running the Software Update control panel in Classic tells you that your OS 9 software is up-to-date, regardless of whether it actually is or isn’t. (In newer versions of OS X, the OS 9 Software Update control panel won’t even launch in Classic.)

So how do you update your OS 9 system software for Classic? Good question. On Macs that support booting into Mac OS 9, you can simply reboot into Mac OS 9 and use the OS 9 Software Update control panel. The problem with this approach is that recent Macs can no longer boot into OS 9. To get around this, Apple has taken to updating the copy of OS 9 used by Classic in a slightly roundabout, but clever, manner.

It’s a good bet that at some point you’ve started Classic and been greeted by the message that your OS 9 System Folder needs to be updated or is missing files that are needed in order to use the selected copy of OS 9 with Classic. If you allow these changes, the Classic Startup application places updated versions of the necessary files in your OS 9 System Folder. It actually gets these files from within the Classic Startup package. To see them, choose Go Ø Go to Folder… in the Finder, type /System/ Library/CoreServices/Classic Startup/Contents/Resources/UniversalForks in the resulting dialog, and then click the Go button. You’ll be taken to the UniversalForks folder (which is normally invisible in OS X 10.3 and later) inside the Classic Startup package. "Fresh" copies of the startup files used by the Classic environment are stored here.

What this means is that when an update to the Classic System Folder is required, Apple includes it in a Mac OS X update. Specifically, the Classic Startup package gets updated. Then the next time you launch Classic, you get the aforementioned message, and Classic Startup actually installs the updated System Folder components. Clever, eh? (In fact, you’ll find that OS 9 System Folders used by the Classic environment in newer versions of OS X actually have newer versions of many startup files than a System Folder that’s used only to boot into OS 9—OS 9’s Software Update doesn’t always update System Folder files to the same versions needed by the Classic environment in OS X.)


The Classic System Preferences

User Level | any
Affects | individual user
Terminal | no

Using the Classic environment is generally pretty simple and doesn’t require a lot of tweaking and twiddling. However, the Classic environment does have a few of its own settings, as well as a few tools for monitoring it. You can find these in the Classic pane of System Preferences.

The Start/Stop Tab (and How to Start Classic)

The general preferences for the Classic environment are located in the Start/Stop tab; for most uses, this is the only tab you’ll need to worry about.

As I explained earlier, when you launch Classic, it loads an entire iteration of Mac OS 9. (In fact, when the Classic launch screen appears, if you click the disclosure triangle next to “Show Mac OS 9 startup window,” you’ll see what looks like a Mac OS 9 startup screen, complete with the icons of OS 9 extensions as they load.) However, first you need to tell it which Mac OS 9 System Folder you want it to use. You do this in the box under “Select a system folder for Classic” (Figure 8.1). Each mounted volume is listed. If a particular volume has a valid Mac OS 9 System Folder installed, the volume is selectable; if a volume has more than one OS 9 System Folder installed, click the disclosure triangle to the left of the volume name to view them all. (Hold the mouse cursor over a System Folder in the list to see a “tool tip” that identifies the version of Mac OS 9 it contains.) Select the desired volume or, if the volume has multiple System Folders, the desired System Folder, and Classic will use the appropriate System Folder the next time Classic is launched.

Figure 8.1: The Start/Stop pane of Classic preferences
Note

If for some reason you boot between Mac OS X versions (for example, 10.2 and 10.3), note that once you’ve used a Mac OS 9 System Folder in Classic under OS X 10.3, it will no longer work under OS X 10.2’s Classic environment. (In general, it’s safe to assume that this will apply to newer versions of Classic in Mac OS X, as well— once you use an OS 9 System Folder in a newer version of Classic/Mac OS X, it won’t work with older versions.) Thus, if you need to switch between versions of Mac OS X, I recommend having a different OS 9 System Folder for each Classic environment.

Tip

If you’re having trouble selecting a System Folder or volume for Classic, I’ve included a few solutions later in the chapter under “Classic Trouble.”

Start Sidebar
Where to Put the Classic System Folder

The OS 9 System Folder used by Classic can be located on any mounted volume; as I mentioned in the main text, you just select the appropriate System Folder in the Start/Stop tab of Classic preferences.

However, if you’re a clutter-hater, you may not appreciate yet another folder, containing hundreds of files, on your hard drive, especially if you don’t use Classic very often. If this sounds like you, you can instead place the OS 9 System Folder on a disk image. To do so, use Disk Utility (Disk Copy in OS X 10.2 and earlier) to create a read/write disk image that’s 50MB–100MB larger than the OS 9 System Folder to be placed on it. Then install OS 9 onto the mounted image. (The easiest way is to simply drag over a copy of an existing OS 9 System Folder.) Select that System Folder in Classic preferences while the disk image is mounted. From this point on, whenever you launch the Classic environment, OS X will automatically mount the disk image for you. The rest of the time the Classic System Folder is stored in a single file. (I mention a similar trick in the Online Appendix for dealing with multiple OS 9 System Folders.)

End Sidebar

Starting/Stopping Classic

In general, there are four ways to launch Classic. The first, and easiest, is to simply launch any Classic application; the Classic environment will automatically launch and load OS 9, and then the application will be launched from within Classic. The second method is to check the “Start Classic when you log in” box in Classic preferences, which automatically launches Classic at login. (If you check the “Hide Classic while starting” box, the Classic startup window will be hidden; if you’re not a fan of screen clutter, this is a nice option.) The third way is to manually click the Start button in Classic preferences, which launches Classic immediately; after it’s done loading, you can launch your Classic application(s). Finally, if you’ve enabled the Classic status menu (discussed in the next section), you can choose Start Classic from that menu to start Classic immediately. Although the first two methods are convenient, users have reported problems with both Classic and Classic applications when launching Classic in these ways. The frequency of such problems seems to diminish with each update to Mac OS X, but they still occur occasionally. Therefore, I recommend that you just launch Classic manually when you need to use it. (A bit later in the chapter, in “Using Classic,” I show you a few other ways to launch Classic manually using third-party utilities.)

If Classic is running, the Start button changes to Stop. Clicking this button is identical to choosing the Shutdown command in Mac OS 9; all Classic applications will quit (you’ll be able to save changes first), the copy of OS 9 used by Classic will “shut down,” and then the Classic environment will quit. Likewise, the Restart button functions just like the Restart command in OS 9 (a shutdown followed by an immediate startup). Note that this Shutdown command affects only the Classic environment, not Mac OS X. The third button, Force Quit, works exactly like the various force quit procedures I discussed in Chapter 7 except that it immediately, and ungracefully, quits the Classic environment and all Classic applications. You should use this command only when the Classic environment crashes or freezes and you can’t use any of your Classic applications. (Keep in mind that you’ll lose any unsaved changes in Classic applications.)

The Start/Stop tab has two other options I haven’t yet covered. The first is “Warn before starting Classic.” This option, introduced in OS X 10.2, will warn you if you launch a Classic application and the Classic environment isn’t already running. If you used earlier versions of Mac OS X, you probably experienced the frustration of accidentally starting the Classic environment by inadvertently launching a Classic application (for example, by double-clicking a document associated with a Classic application). You could click the Stop button in the Classic startup window, but Apple recommended against this (and, in fact, you got a warning message when you tried). When this option is checked, if you start Classic by launching a Classic application, you’ll get a dialog asking if you really want it to start (Figure 8.2), with the options Don’t Start and Start Classic.

Figure 8.2: The “Warn before starting Classic” dialog

The final option, “Show Classic status in menu bar,” is a nice enough feature that it deserves its own section.

The Classic Status Menu

The remaining checkbox in the Classic pane of System Preferences is “Show Classic status in menu bar.” New in OS X 10.3, this option places a new menu extra in the OS X menu bar that provides a number of Classic-related options. First and foremost, it indicates Classic’s current state via the menu’s icon in the menu bar: An “empty” icon means Classic isn’t running, whereas an icon that’s darker and partly filled means that Classic is active (Figure 8.3).

Figure 8.3: The Classic status menu shows you if Classic is stopped (left) or running (middle). It also lets you quickly start and stop Classic and access the Classic Apple Menu (right).

In addition, you can access several useful options via the menu itself. The first item in the menu is simply another indicator that mirrors the menu’s icon—it states either “Classic is not running” or “Classic is running.” Below that, the Start/Stop Classic and Restart Classic commands allow you to quickly start, stop, and restart Classic without having to open the Classic pane of System Preferences. On the other hand, if you want to open Classic preferences, you can use the menu to do so directly.

Finally, one of the nicest features of the Classic status menu is the ability to access the Classic Apple Menu, discussed later in this chapter and in the Online Appendix, from within any application. You can quickly see the contents of the Apple Menu Items folder and even open any item within it via the hierarchical menu. (You can even use this functionality as a way to quickly access files and folders; I discuss this ability later in the chapter in “Using the Classic Apple Menu.”)

Tip

If you’re using OS X 10.2 or earlier and the functionality of 10.3’s Classic status menu sounds attractive, there are a couple of great freeware menu extras that you can use to control the Classic environment. Classic Spy (http://www.anoshkin.net/) and Classic Control Menu (http://www.monkeybreadsoftware.de/Freeware/ ClassicControlMenu.html) both provide a simple menu that allows you to start or stop Classic or to open System Preferences. Both of these menu extras require the freeware Menu Extra Enabler (http://www.unsanity.com/products/free) to function properly under OS X 10.2 and later.

The Advanced Tab

The Advanced tab of Classic preferences has a few additional options associated with the Classic environment. These are mainly “set and forget” preferences, along with a few options that you would use mainly when troubleshooting.

Startup Options

When booting up your computer under OS 9, you could select several startup options, such as booting with extensions disabled, opening Extensions Manager, or holding various keys down to invoke other options or to activate third-party utilities. Under Startup Options, you can take advantage of the same options when starting up the Classic environment; just select the corresponding action from the pop-up menu and then click the Start Classic button (or Restart Classic if Classic is currently running). If you choose Use Key Combination, a box will appear allowing you to designate the keys you want to be “pressed” as Classic is launched.

Why would you want to use these options? Remember that Classic loads a full version of Mac OS 9. Just as you can have startup file conflicts in OS 9, so too can those kinds of conflicts occur in Classic. Just as you can use Extensions Manager (or similar utilities such as Casady & Greene’s Conflict Catcher, no longer in development but still available around the Web) to manage startup files when booting into OS 9, so too can you manage startup files in Classic. (I’ll talk more about this later in the chapter in “Optimizing Classic.”) Note that this option is a one-shot deal—it affects only the single startup or restart initiated by clicking the Start/Restart button in this tab.

Note

The Use Key Combination option applies only if you click the Start/Restart button in the Advanced tab of Classic preferences; starting Classic any other way will cause Classic to start up normally. Also, if you’re using the Use Key Combination option, be sure that during Classic startup you don’t actually press and release (via the keyboard) the keys you’ve chosen; doing so will make Classic think that the keys are no longer “being pressed.”

The “Use Mac OS 9 preferences from your home” option allows each user to have their own preferences for Classic applications. Under pre-10.2 versions of OS X, Classic applications each had a single preference file, shared by all users, located in the Preferences folder of the System Folder used by Classic. Under OS X 10.2 and later, if this option is checked, Classic applications store their preferences in each user’s ~/Library/Classic/Preferences folder. Note that this option is user-specific, unlike other Classic preferences. That is, each user gets to decide whether to use the preferences for OS 9 and Classic applications located in their home directory (by checking the box) or to use those in the OS 9 System Folder being used by Classic.

Tip

Another advantage to the “Use preferences from home folder” option—besides allowing each user to have their own preferences for Classic applications—is that if you use the same OS 9 System Folder for Classic and for booting into OS 9, you also get a separate set of preferences when booting into OS 9. The preferences in the /System Folder/Preferences folder are used in OS 9, and those in each user’s ~/Library/Classic/Preferences folder are used in Classic.

If you enable the “Use Mac OS 9 preferences from your home” option, the first time each user launches Classic the following folders will be created in their home directory (under ~/Library/Classic): Apple Menu Items, Internet Search Sites, Launcher Items, Preferences, Shutdown Items, Startup Items. In addition, if they exist in the Classic System Folder, these folders will also be created: Desktop Pictures, Favorites, Keychains, Locations, Shutdown Items (Disabled), Startup Items (Disabled), Volumes. The user will be asked if they want the contents of the corresponding Apple Menu Items, Preferences, Internet Search Sites, and Launcher Items folders in the Classic System Folder to be copied to their home directory. Choosing the Copy Contents option will do so; choosing Leave Empty will not. One consequence of not allowing this copy is that the Chooser will not appear in the Apple Menu, meaning the user won’t be able to print from within Classic.

Classic Sleep (“Put Classic to sleep when it is inactive for” in OS X 10.2)

When Classic is running, it takes up a good deal of system resources (RAM, CPU cycles, etc.). You can have the Classic environment automatically “sleep” after the amount of idle time you select in this section (provided no Classic applications are running); when Classic is sleeping, it uses virtually no system resources. That being said, many users have reported problems with Classic when using this option; when waking from sleep, the computer can freeze, or certain hardware functionality (e.g., the USB port) may no longer be accessible from Classic. I recommend setting this option to Never—if you can’t spare the RAM, you’re probably better off quitting Classic when you aren’t using it.

Rebuild Classic Desktop (“Other Classic Utilities” in OS X 10.2)

The Rebuild Desktop button allows you to manually rebuild the desktop database files used by Classic and Classic applications to associate documents with applications. These database files affect the applications used to open files when they’re double-clicked, as well as file icons in the Finder. (Note that these database files are used only by Classic for files that should open in Classic applications; rebuilding the Classic desktop will have no effect on Mac OS X.)

You can rebuild these databases at any time by clicking the Rebuild Desktop button, even if Classic is already running. In OS X 10.3 or later, a dialog appears listing all local volumes; you can choose to rebuild the desktop database files on any or all volumes. (If you choose to rebuild the desktop on multiple volumes, they will be rebuilt in sequence.)

In OS X 10.2, the Rebuild Desktop command rebuilds only the desktop database files for the volume that contains the Classic System Folder. In order to rebuild the Classic desktop databases for all mounted volumes, you need to use a procedure similar to that used in OS 9: Use the Use Keyboard Combination option discuseed above, select command+option as the desired keyboard combination, and then start (or restart) Classic. This will bring up the standard OS 9 dialogs just as Classic finishes loading, asking you if you want to rebuild the desktop for each volume. (As a bonus, using this procedure, which also still works in OS X 10.3, Classic rebuilds the desktop databases simultaneously, rather than one at a time.)

The Memory/Versions Tab

The Memory/Versions tab of Classic preferences doesn’t really contain any preferences; it is instead a way to monitor Classic and any running Classic applications.

The top line of the Memory/Versions tab shows the current status of Classic: not running, starting up, stopping, or “Active Applications”—meaning Classic is currently running.

The Active Applications box shows any Classic applications currently running, along with their memory usage (Figure 8.4). This is similar to what you would see in the “About this Computer” box in the OS 9 Finder. In the Memory Use column, the first number listed for each application (represented by the shaded area of each application’s memory bar) is the amount of memory actually being used by the application. The second number (represented by the entire memory display bar) is the “preferred” memory amount requested in the application’s Get Info window (unless that amount of memory is unavailable, in which case it represents the amount that Classic has allocated for the application). If you check the “Show background processes” box, you’ll also be able to view any background applications running in Classic (such as Classic Support, which is always running in the background in Classic).

The bottom of the window provides information on the version of Mac OS 9 being used by Classic, the versions of the Classic support files installed in the Mac OS 9 System Folder (discussed below), and the version of the actual Classic environment application.

Figure 8.4: The Memory/Versions tab of Classic preferences
Tip

If you hold the option key down when you click the Memory/Versions tab, an Adjust Memory button will appear at the bottom of the Memory/Versions window. If you click this button, you’ll see a dialog that lets you adjust the balance between application memory and temporary memory available to Classic applications. Moving the slider toward Temporary Memory increases the amount of Classic memory reserved for temporary memory, which is memory allocated to applications above and beyond their usual allocation. I recommend leaving this setting alone unless you’re told to change it—for example, by the developer of a Classic application who instructs you to change it as a troubleshooting step. (If you make a change to this setting while Classic is running, you’ll need to restart Classic for the changes to take effect.)


Optimizing Classic

Before I get into using Classic, I want to briefly talk about a few ways in which you can make it work better, faster, and with more stability.

Customize Your System Folder for Classic

As I mentioned when discussing Classic preferences, when Classic loads Mac OS 9, it goes through much of the same startup process that would occur when booting directly into OS 9, including the loading of extensions and control panels. This is great news if some of your Classic applications require specific OS 9 startup files to function. However, in practice, you probably don’t want all of the startup files that load when booting into OS 9 to load when starting Classic, for three reasons.

First, many extensions and control panels simply don’t work in Classic—these files don’t cause any problems, but they don’t provide any functionality, either. For example, control panels that would provide system-wide functionality that’s already provided by Mac OS X, such as the Appearance or File Sharing control panels, fall under this category.

Second, just as many startup files use RAM when booting into OS 9, many startup files use RAM when OS 9 loads in the Classic environment—the more that are loaded at startup, the more RAM Classic will require to run. So you can reduce the memory usage of the Classic environment as a whole by not loading unnecessary startup files.

Finally, and most important, many extensions and control panels either work inconsistently in Classic or actually cause problems when loaded by OS 9 in Classic. Yes, you read right—startup/extension conflicts are alive and well inside the Classic environment. So it follows that removing all but the essential startup files from your Classic System Folder will improve stability and possibly even performance.

Note

Some of the third-party extensions and control panels that cause the most problems with Classic are those that alter the appearance of OS 9 (such as menu utilities) or that patch the system to provide system-wide functionality (such as utilities that affect virtual memory).

If you’ve ever used Extensions Manager or Conflict Catcher in OS 9 to manage startup files, you know the drill—you’re provided with a list of startup files, and you check or uncheck the box next to each to enable or disable it, respectively (Figure 8.5). You can open Extensions Manager, or Conflict Catcher if it’s installed, from the Control Panels folder in the Classic System Folder (or access it from Apple Menu Ø Control Panels when a Classic application is active, or from the Apple Menu Items sub-menu of the Classic status menu). If you’ll be using the same System Folder for Classic and when booting into Mac OS 9, I recommend creating a new set in Extensions Manager or Conflict Catcher that’s used only for Classic (I call mine, creatively enough, Classic).

Figure 8.5: Using Conflict Catcher to manage Classic startup files

If you decide to slim down your Classic System Folder, first use the list of files I’ve provided here to figure out which ones are required by Classic itself (see the sidebar “OS 9 Startup Files Required for Full Classic Functionality”). Then install or enable any third-party startup files needed by applications and/or hardware you’ll be using in Classic (for example, Microsoft Office 2001 requires certain startup files in order to function properly).

Tip

If you need to install third-party startup files into the Classic System Folder, and those files require an installer, it’s often easier to do this when booted into OS 9. If your Mac can boot from Mac OS 9, start up into the copy of OS 9 used by Classic (by choosing that System Folder in Startup Disk preferences and restarting), install all of your third- party Classic applications and startup files, and then boot back into Mac OS X. If you’re wondering what all the third- party startup files do, so you can make a decision about enabling/disabling them, check out my own guide to the Classic System Folder, InformINIT (http://www.InformINIT.com/), or the shareware Extension Overload (http://www.extensionoverload.com/), or use the file descriptions provided by Casady & Green’s Conflict Catcher.

Partitions and Multiple System Folders

If you have an older Mac that can still boot into Mac OS 9, and you frequently switch between booting into OS X and booting into OS 9, I recommend that you have two System Folders, one optimized for Classic, the other fully loaded with all of your standard OS 9 goodies for use when booting into OS 9. I also recommend that you do this using multiple hard drives or (if you only have a single drive) by partitioning your drive. Rather than discussing such a setup here, I refer you to the discussion I’ve provided in the Online Appendix.

Buy More RAM

OK, this isn’t really a way to “optimize” Classic. In fact, one could argue that it’s just the opposite— a way to get around optimizing it. Either way, if you use Classic a lot, you should really consider buying and installing extra RAM. The Classic environment isn’t a text editor that takes up a tiny amount of memory; it’s loading an entire copy of OS 9 and running applications on top of that, so its memory demands can get quite large. Even though Mac OS X’s virtual memory and memory management systems are very good, the truth is that if you don’t have enough RAM, performance can be affected (both the performance of Classic and the performance of OS X as a whole). I personally believe that OS X by itself requires at least 256MB of RAM, and starts to really shine with twice that—the increases in speed and stability are significant. If you use Classic frequently, add another 128MB or even 256MB. (To give you some perspective, my PowerBook has 1GB, and my PowerMac has 1.5GB.) RAM is cheap nowadays; take advantage of it.

Start Sidebar
OS 9 Startup Files Required for Full Classic Functionality

Although you can optimize the Classic System Folder by removing startup files (extensions, control panels, etc.), there are a few files that are required for Classic to function; the list below will help you figure out what not to remove. If you have all the files listed here, you’ll get “full functionality” of OS 9 in Classic. (However, you may want to also enable the Shared Library Manager and Shared Library Manager PPC extensions since some third-party Classic applications, such as Microsoft Office 2001, require them.)

Items with an asterisk (*) are the minimum files you need under Mac OS 9.2.2 (the most recent version of OS 9 at the time of this writing) in order to start the Classic environment; if any of these files are missing when Classic starts up—including the first time you ever launch Classic—you’ll get a dialog telling you that Classic needs to install missing files (you should let it). However, with only these files, you may not get full functionality.

If you’re running Mac OS X 10.3 or later, the files used by Classic are as follows:

Root level of System Folder:

  • Classic*

  • Classic Support*

  • Classic Support UI*

Control Panels folder:

  • Apple Menu Options

  • Extensions Manager

  • General Controls*

  • Internet

  • Keyboard*

  • Startup Disk* (only on those machines that can boot from OS 9)

  • USB Printer Sharing

Extensions folder:

  • Apple Guide*

  • AppleScript*

  • AppleShare

  • CarbonLib*

  • Classic RAVE*

  • File Sharing Extension

  • Global Guide Files* (this is actually a folder)

  • InputSprocket Classic*

  • LaserWriter 8

  • Network Setup Extension*

  • Open Transport*

  • Open Transport ASLM Modules*

  • OpenGLLibrary

  • OpenTpt Remote Access

  • PrintingLib

  • PrintMonitor

  • QuickDraw 3D RAVE

  • QuickTime Image

  • QuickTime

  • QuickTime PowerPlug

  • USB Printer Sharing Extension

Scripting Additions folder:

  • Standard Additions*

If you’re running Mac OS X 10.2 or earlier, the list of files is slightly different; I’ve posted this information on the book’s website (http://www.macosxpowertools.com/).

End Sidebar


Using Classic

As I wrote earlier in the chapter, using Classic is for the most part straightforward—when Classic is running you simply launch and use Classic applications as you would any other applications. You can even copy and paste data between Classic and OS X applications, or use drag-and-drop to move data between them. However, there are a few areas, such as printing, where you’ll need to set things up, a few areas in which Classic might not behave the way you expect, and a few ways you can make using Classic a bit easier.

Classic Peculiarities

Although you can switch to and between Classic applications using the Dock, just as you can with OS X applications, there are a few ways in which Classic doesn’t work quite as seamlessly as Apple would have you believe. Most of these inconsistencies relate to appearances—application windows, menus, Open/Save dialogs, and the Apple Menu—but there are also issues that arise in terms of preferences and application launching.

Start Sidebar
How Can I Tell If Classic Is Running?

One complaint that many users have about the Classic environment is that it’s sometimes difficult to tell if it’s currently running. If you’re the type who wants to know, here are a few solutions:

  • Enable the Classic status menu—as described earlier in the chapter, its icon and the first item in the menu itself both indicate Classic’s status.

  • Open the Start/Stop tab of Classic System Preferences; if Classic is running, you’ll see the bold text

  • “Classic is running” followed by text indicating which OS 9 System Folder is being used by Classic, and the Start button will have changed to Stop.

  • If a Classic application is running, you’ll see its icon in the Dock, which means Classic is running, as well. (This may seem obvious, but I know users who actually keep a tiny Classic app, such as Note Pad, running just so they can tell that Classic is running.)

  • Mac OS X’s Force Quit window will include “Classic Environment” in the list of running applications when it is active. Likewise, the Activity Monitor utility will show “null” in the list of running processes, although “null” may also represent other processes, so this isn’t a foolproof method. (Under OS

  • X 10.2 and earlier, the Process Viewer utility will show “TruBlueEnvironme” instead.) Finally, the top command in Terminal will include "TruBlueEnv" in the list of processes when Classic is running.

  • The third-party menu utilities I recommended earlier in this chapter (Classic Control Menu and Classic Spy), as well as the Dock utility Classic Toggler, mentioned later in this chapter, all provide visual feedback as to whether or not Classic is running. As another option, the freeware system monitoring utility System Manager (http://www3.nb.sympatico.ca/gamson/SystemManager/) also has greatDock and menu bar displays for monitoring the Classic environment.

End Sidebar

Appearance

When you switch back and forth between OS X and Classic applications, you’ll notice immediately that Classic applications don’t take advantage of OS X’s Aqua interface. Classic application windows have the Mac OS 9 Platinum appearance (including the WindowShade button, which works as expected), as do menus and dialogs. The menu bar itself changes to an OS 9–style menu bar, including the OS 9 application menu on the right and the traditional Apple Menu on the left (Figure 8.6). (In addition, OS X’s menu extras will disappear and will be replaced by any Classic Mac OS menu items provided by the copy of OS 9 being used by Classic.) Classic windows also don’t take advantage of such Aqua features as transparency and live resizing.

Another area where you’ll see significant differences between Classic and OS X application is Open/Save dialogs. Again, because Classic applications can’t take advantage of the Aqua interface, they use the older dialogs found in OS 9—either the standard modal dialogs that aren’t movable and force you to address them before doing anything else or the newer Navigation Services dialogs that are modal only for the current application. Contrast these dialogs with OS X’s dialogs, which are document specific (you can switch to any other application, or even other documents in the same application, when an Open/Save dialog is open).

Note

Some applications that have been Carbonized for OS X will still use OS 9–style dialogs if the developer didn’t choose to take advantage of Mac OS X’s Aqua dialogs.

Click To expand
Figure 8.6: The menu bar for the shareware text editor Tex-Edit Plus in OS X (top) and Classic (bottom)

Application Launching

Although the process of launching Classic applications is nearly identical to the process of launching OS X applications, there are a couple of situations where the existence of the Classic environment can throw a wrench in the process. The first is related to Carbon applications; the second has to do with having both a Classic and OS X version of the same application on your hard drive.

Launching Classic and Cocoa applications is simple; Classic applications launch in Classic, and Cocoa applications launch in OS X. However, some Carbon applications—those that aren’t OS X–only—can actually be launched in both OS X and OS 9. This presents an interesting challenge for your Mac. When you double-click such an application, how does it know whether to launch in OS X or Classic? The answer is a simple setting in the application’s Get Info window (Figure 8.7). By checking the “Open in the Classic environment” option, the application will always open in Classic; unchecking the box will cause the app to open in OS X.

Figure 8.7: You can launch the Palm Desktop application as either an OS X or a Classic application.

The other anomaly can occur when you have both a Classic and an OS X version of the same application on your Mac (for example, the e-mail client Microsoft Entourage). Assume for the moment that you’ve chosen Entourage as your preferred e-mail client in both Classic and OS X. If you click an e-mail link in a Classic application, and the OS X version of Entourage is running, the e-mail link will open (via a new e-mail message) in that version; however, if the OS X version isn’t running, the mail link will open in the Classic version. There are two reasons why this can occur. The first is that when Classic needs to launch an application, sometimes it simply looks for Classic applications first. The other—which can happen when the Mac OS X version of the application is provided as an OS X application package—is due to the way Classic views packages. As discussed in Chapter 7, an application package is actually a folder disguised as a single file. OS X understands this organizational trick, but Classic doesn’t; it sees an application package as a folder. Thus when Classic needs to open a file in an application, if the application is already running, it works fine; however, if the application isn’t running, sometimes Classic can’t “find” the OS X version. When this happens, Classic then looks for a Classic version of the application. The good news about this problem is that it’s fairly obscure—you need to have both OS 9 and OS X versions of an application on your hard drive, with the OS X one not running, and then, from within a Classic application, open a file or URL that’s normally handled by that application. Mail clients and Web browsers are the most common culprits.

Preferences

Classic applications use their own preference files, located in either /Classic System Folder/Preferences or ~/Library/Classic/Preferences (depending on the setting you’ve chosen in Classic preferences). Although this method of organization generally works well, there are two areas in which it can become confusing: when you have two versions of an application, one that runs in Classic and one that runs in OS X (or a Carbon application that can open in either one), and when you’re dealing with networking and Inter- net preferences.

Many applications have both OS X and Classic versions. If for some reason you use both of these versions (for example, certain Web pages seem to work better with the Classic version of Internet Explorer than the OS X version), keep in mind that the two use different preference files, so unless you set them up identically, they may behave differently. (In fact, you may want them to behave differently, so this isn’t necessarily a bad thing.) Likewise, as mentioned above, some Carbon applications can run in either OS X or OS 9, and will thus use different preference files depending on whether they're launched as OS X or Classic applications.

In terms of Internet and networking preferences, you’ll remember that all Classic networking is tunneled through Mac OS X. This means that the settings you choose in the Network pane of OS X’s System Preferences also apply to Classic. However, the Internet helper settings and behavior of Classic applications are not controlled by the settings in OS X’s Internet preferences. Rather, Classic uses the settings in the Classic Internet control panel or InternetConfig utility. For example, both OS X’s Internet preferences and the Internet control panel in Classic have settings for your preferred Web browser or e-mail client. If these settings are different, clicking a URL or e-mail link in an application may produce different results depending on whether that application is a Classic or OS X application.

Start Sidebar
Classic Applications and Memory

In addition to the application-launching topics already discussed, there are a couple memory-related issues you should be aware of if you use Classic often.

The first is that, to applications, virtual memory appears to be disabled within the Classic environment. Any Classic application that requires that virtual memory be enabled will not run in Classic. (In reality, virtual memory is active across OS X and the Classic environment; however, since virtual memory is managed by OS X, the Classic environment disables OS 9’s own virtual memory system.)

The second issue relates to memory allocation and Classic applications. OS X manages the memory allocated to OS X applications, and to the Classic environment itself. However, since Classic is running an actual copy of Mac OS 9, applications running within Classic use OS 9’s memory management system. This means that whereas OS X applications will be given as much memory as they need, when they need it, Classic applications still use the memory settings in their Get Info windows. When you use the Finder’s Get Info command on a Classic application, a Memory panel is provided to allow you to manually set the memory allocation requested by the application when it’s launched. This means that, just as in OS 9, if a Classic application can’t open a file because it doesn’t have enough memory, you’ll need to quit the application, increase its memory allocation, and then try again. Likewise, if you see—using the Memory/Versions tab of Classic preferences—that a particular Classic application never seems to come close to using its current memory allocation, you can use that application’s Get Info window to reduce the Preferred Size setting. (Just don’t reduce it below the Minimum Size setting.)

One bonus of the Classic environment over a Mac running OS 9 is that OS X gives the Classic environment a full 2GB of memory space. This means you can give Classic applications much more memory than you would have given them had you actually booted into OS 9. Although you don’t want to abuse this feature— the more memory you allocate to Classic applications, the more OS X will need to rely on virtual memory, so the more your Mac will have to swap memory to and from the hard drive—it’s safe and often very convenient.

End Sidebar

Using the Classic Apple Menu

When a Classic application is active (and, thus, the menu bar takes on the Classic Mac OS appearance), you can actually use the Classic Apple Menu just as you did in Mac OS 9. You can even customize it, just as you may have done under OS 9, by customizing the contents of /Classic System Folder/Apple Menu Items (if you don’t have the "Use Mac OS 9 preferences from your home" option checked in Classic preferences) or ~/Library/Classic/Apple Menu Items (if you do). In fact, many people who are fond of the Classic Apple Menu keep a Classic application running at all times just so they can switch to it to access the Classic Apple Menu. By selecting an item from the Classic Apple Menu, it will open just as if you had double-clicked the item in the Finder.

Under OS X 10.3 and later, you don’t even need to switch to a Classic application to access the Classic Apple Menu; you can access it from the Classic status menu in the menu bar. (If you’re using OS X 10.2 or earlier and would like similar functionality, check out the Online Appendix for some solutions.)

If you actually want an OS 9-like, customizable Apple Menu in OS X, the Online Appendix covers that topic, as well.

Starting and Stopping Classic from the Dock

I recommended earlier in this chapter that you start and stop Classic manually because of potential problems with having Classic automatically start at login or when launching a Classic application. In OS X 10.3, Apple made doing so much easier via the Classic status menu (described earlier in this chapter). However, if you’re still using OS X 10.2 or earlier, or if you don’t want to add yet another menu extra to your menu bar, you may find it more convenient to start and stop Classic from the Dock than to have to open the Classic pane of System Preferences.

The easiest way to start Classic from the Dock is to place the Classic Startup application—which is used by OS X to load Classic—in the Dock by dragging it to the Dock from its location at /System/ Library/Core Services/Classic Startup. When you want to start Classic, just click the Classic Startup icon in the Dock. The only drawback to this method is that you still have to quit Classic by using the Classic status menu or by opening the Classic pane of System Preferences—you can’t quit it by control/right-clicking the Classic Startup icon in the Dock and choosing the Quit command, as you do with most other applications. (In fact, the Classic Startup application runs only until Classic finishes loading, so you also can’t tell if Classic is running by looking at the Classic Startup icon in the Dock; however, if you click the icon while Classic is already running, a message will pop up telling you so.)

A third-party utility that offers a bit more functionality is the shareware Classic Toggler (http://www.northernsoftworks.com/classictoggler.html). Classic Toggler is a standard OS X application; when you launch it, its Dock menu includes Startup and Shutdown commands for the Classic environment. In addition, by switching to Classic Toggler, you can use its Classic menu (the menu is actually called Classic) to launch the OS 9 Chooser or Extensions Manager, launch frequently used Classic applications, and access Classic items such as the OS 9 Desktop, Apple Menu, Control Panels, and the System Folder. (You can even install items in these folders by simply dropping them on the Classic Toggler icon in the Dock.) As an added bonus, by choosing Classic Ø Preferences Manager… or Classic Desktop Manager… you can quickly synchronize items between your OS 9 and OS X Preferences fold- ers or Desktop folders, respectively. Classic Toggler also provides excellent visual feedback about whether or not Classic is currently running (see "How Can I Tell If Classic Is Running?").

Printing in Classic

Printing is one of the few ways in which Classic has its own, independent, settings with respect to connected hardware. As long as your printer is visible to the Classic environment (meaning it’s connected to a supported port or available via OS X’s network connections), you use the Classic Chooser (located in the OS 9 Apple Menu Items folder) to choose the printer, just as you would have done if you had booted into Mac OS 9. This means that to print from Classic you need to install the appropriate OS 9 printer drivers from within Classic (or, if your Mac is able, while booted into OS 9). I discuss Classic printing, and printing in general, in more detail in Chapter 12.

Note

Unfortunately, OS 9’s Desktop Printers aren’t supported by Classic, so you have to use the Classic Print- Monitor application (located at /Classic System Folder/Extensions/PrintMonitor) to monitor print jobs.

Note

In order to print in a Classic application, users need to be able to access the Classic PrintMonitor application. This means that if you use the Limitations tab of Accounts preferences to manage a user’s access (as described in Chapter 1), if you want that user to be able to print from within Classic, you need to include PrintMonitor in the list of “allowed” applications.


Classic Trouble

I mentioned earlier in this chapter that because using Classic involves so many layers, there are more places where things can go wrong. In addition, because Classic boots up a full version of Mac OS 9, most things that could go wrong in OS 9 can also go wrong in Classic. Although I can’t spend too much time talking about troubleshooting the Classic environment, here are some of the most common problems people have, along with some solutions. In addition to the problems discussed here, the Online Appendix includes a discussion of some of the issues you may encounter when switching between booting into OS X and OS 9.

Startup File Conflicts

As I previously explained, just as OS 9 was sometimes plagued by startup file conflicts, the Classic environment can suffer the same fate. If you find that Classic is freezing during startup, or that Classic applications are behaving oddly (but OS X applications are working fine), the problem could be caused by startup files that don’t play well together.

As under OS 9, the first step toward determining if a startup file is at fault is to start Classic with extensions and other startup files disabled. In the Advanced tab of Classic preferences, under Startup Options, choose Turn Off Extensions from the pop-up menu, and then click the Start Classic button. If Classic loads properly and your problems are gone, a startup file conflict is probably the culprit. (If not, then some more advanced troubleshooting methods are in order.)

How to manually discern which startup file(s) are the source(s) of your problems is both too deep (in terms of length of the discussion) and too basic (this kind of troubleshooting has been around the Mac platform for 15 years or so) a topic to get into here. Instead of explaining the procedure, I again recommend that you find a copy of Casady & Greene’s Conflict Catcher if you don’t already have one. (Unfortunately, Casady & Greene is no longer in business, but it’s not too difficult to find a copy of Conflict Catcher for sale on the Web.) Although Conflict Catcher was originally written for Mac OS 9, the most recent version was specifically updated for compatibility with the Classic environment. Besides its excellent startup file management abilities, which I talked about earlier in the chapter, it also has an automated conflict test feature to help you find the cause of startup file conflicts. Best of all, whereas the testing procedure in OS 9 required multiple restarts of your computer, when Conflict Catcher runs in Classic, you can do other things on your computer; Conflict Catcher will automatically restart Classic in the background as it tests.

Note

In addition to startup file conflicts, Classic can also fall victim to other startup issues that affect OS 9. For example, if you have aliases to AppleShare servers in your OS 9 Startup Items folder, and one or more of those servers isn’t available, OS 9 will often hang at startup. The same thing will occur in Classic—it may freeze just as OS 9 has finished loading, at the point where OS 9 Startup Items normally load.

Classic and Classic Application Crashes

It’s bound to happen sooner or later—one of the applications you’re running in Classic will crash. Unfortunately, Classic isn’t as stable as Mac OS X, so chances are the application won’t exit gracefully. (And if it crashes and quits, it may cause the entire Classic environment to crash and quit as well.) If a Classic application has frozen, or if a problematic application freezes the Classic environment itself, here are some ways to get out of it.

When a Classic applications freezes, you should generally treat it just like any other application and use one of the methods discussed in Chapter 7 to force quit it. However, be aware that force quitting a Classic application will almost always force the entire Classic environment to quit; you should first try to save any changes in open documents in other Classic apps.

In addition to Classic application freezes, sometimes the Classic environment itself will crash or freeze. If it crashes, it will usually quit entirely (taking any running Classic applications with it). However, if it freezes, you’ll need to quit it yourself. The easiest way to escape a frozen Classic environment is to click the Force Quit button in the Start/Stop pane of Classic System Preferences. This will quit Classic immediately, along with all Classic applications, without giving you a chance to save your work. (Although that’s probably not an issue if you’ve resorted to force quitting Classic.) If this doesn’t work, remember that Classic is simply an OS X application; you can use any of the procedures I listed in Chapter 7, when I discussed how to force a misbehaving application to quit, to quit Classic itself.

Inability to Select a System Folder in Classic Preferences

User Level | depends on procdedure
Affects | all users
Terminal | maybe

Sometimes a Mac OS 9 System Folder that you know exists isn’t listed in the Classic pane of System Preferences. If your Mac can boot into Mac OS 9, you can often remedy this by switching to the Startup Disk pane of System Preferences, selecting that System Folder as the startup OS, and then switching back to Classic preferences (you may need to quit System Preferences and relaunch it in between). The System Folder should now appear as a valid selection for use in Classic. After you’ve selected it, be sure to go back to Startup Disk preferences and re-select your normal startup volume as the startup OS.

If your Mac is a newer model that is unable to boot into Mac OS 9, another solution is to open Terminal and type sudo bless -folder9 ’/System Folder’ -setOF <RETURN> (if the System Folder you’re trying to use for Classic is located on the boot volume) or sudo bless -folder9 ’/Volumes/ volumename/System Folder’ -setOF <RETURN> (if the System Folder resides on a different volume; volumename is the name of the volume). This command tells Mac OS X that the referenced System Folder is indeed a bootable (and thus selectable) System Folder; you should then be able to select it in Classic preferences.

Permissions Prevent Classic from Launching

User Level | admin
Affects | all users
Terminal | no

If the OS 9 System Folder chosen for use by Classic resides on a volume that honors permissions (i.e., the startup volume or a non-startup volume that does not have the “Ignore ownership on this volume” box checked in its Info window, as discussed in Appendix A), it’s possible for the permissions on that System Folder to be set in a manner that prevents its use by Classic. If you’re running OS X 10.3 or later, you can fix this problem by launching Disk Utility and choosing File Ø Fix OS 9 Permissions. (Note that this function repairs permissions only on the OS 9 System Folder currently selected in the Classic pane of System Preferences; if you have multiple OS 9 System Folders and want to repair them all, you’ll need to select each one in Classic preferences and then repair it, one at a time.)

If you’re running an older version of Mac OS X, you need to manually fix the permissions for the OS 9 System Folder. Select the System Folder in the Finder and choose File Ø Get Info. In the Ownership & Permissions section of the Info window, set the Owner to System and the Group to admin; then give Owner, Group, and Others Read & Write access. (If you want to prevent non-admin users from being able to modify the System Folder, change the Group to admin and then change the access level for Others to “Read only.”)


Moving On...

Team LiB

Moving On…

Now that I’ve covered the specifics of files and applications, as well as the Finder and the Dock, it’s time to proceed to the realm of connectivity. Networks and the Internet, sharing files and connecting to remote computers, and printing…these are the topics of the next part of the book. By the time you’re done, you should be your own network administrator.


Part III: The Internet, Networking, Sharing, and Printing

Chapter List

Chapter 9: Networking Notables and Internet Illuminations
Chapter 10: Stellar Sharing Strategies
Chapter 11: Connection Convenience and Remote Control
Chapter 12: Printing Practicalities


Chapter 9: Networking Notables and Internet Illuminations

(Or: Connect and surf faster, easier, friendlier.)

Overview

If you’re a typical Mac user, you spend a good amount of time each day using the Internet: sending and receiving e-mail, surfing the Web, downloading files, and/or chatting with friends. In addition, you may be connected to a local network, through which you access printers and other computers.

Although networking and the Internet are incredibly broad topics that could each fill volumes, in this chapter I’ll touch on some of the tasks related to these topic areas that you’re most likely to do on your Mac. For example, I’ll cover some tips for Internet and Network preferences, as well as some ways to get more out of the Web. Note that I’ll talk about how to share files with other people over a network or the Internet in Chapter 10.

Note

Because this isn’t an introductory-level book, I’m assuming that you’ve already gotten your Internet/network settings from your ISP (or your network administrator, if you’re on a LAN), and that you’re already connected to the Internet. If you’ve got an Internet router, including an AirPort Base Station or other wireless router, I’m also assuming that you’ve already got it set up and working. You may have even set up, or connected to, a local network.


Network Basics

Before I get into some tips for network and Internet setup, I want to briefly discuss networks and network ports in Mac OS X because many users confuse the two.

A network is a group of devices connected in a way that allows them to exchange data with each other. A network can be as simple as a laptop, desktop, and printer in your home, or as complex as millions of computers located all over the world (which is what the Internet really is). Some networks are public (the Internet) whereas others are private (a LAN at your office). Generally speaking, if two or more computing devices are communicating, they’re doing so over some kind of a network.

A network port in Mac OS X refers to the type of connection your computer uses to connect to a network: Ethernet, modem, AirPort/802.11 (wireless), Bluetooth, etc. Even FireWire can be used for networking, although at the time of this writing such networks are rare.

It’s important to know the difference between these terms, and to understand that there’s no inherent link between them. For example, you could use Ethernet to connect to the Internet, but use AirPort to connect to other computers in your office or home. Or you could use AirPort to connect to other computers (and even printers connected to those computers), but use your Mac’s built-in modem for dial-up Internet access. For example, my PowerBook uses AirPort to connect to the Internet and my desktop Mac, but it uses Bluetooth to send files to a friend’s laptop and my wireless phone.

Now that I’ve got that out of the way, let’s talk about the various network- and Internet-related settings.


Network and Internet: Setup Subtleties

Even though I said at the beginning of the chapter that I’m assuming you’ve already got your Mac on the Internet, and maybe even set up your own home network, I’m going to quickly talk about the settings used for these connections, as there are some neat features with which many users aren’t entirely familiar. These features and settings are contained in a few different System Preferences panes and in the Internet Connect Application.

The Network System Preferences

User Level | admin
Affects | computer
Terminal | no

Because of the assumptions I made above, I’m not going to talk about entering specific ISP/net- work settings in the Network pane of System Preferences. However, I do want to cover two of OS X’s very cool network-related features: port priority and Locations. Mac OS X has the ability to mix and match network types and network ports, making it extremely flexible. However, it also has the ability to automatically adapt to various network situations and to quickly switch between sets of network port configurations that you’ve defined, making it the most adaptable OS on the market when it comes to connecting.

Tip

Whenever you make changes to your network settings in the Network pane of System Preferences, you need to click the Apply Now button to put the new settings into effect. (Alternatively, you can simply close System Preferences; you’ll get a dialog asking if you want to “Apply configuration changes.”)

Enabling/Disabling Network Port Configurations

When you open the Network pane of System Preferences, the Show pop-up menu lists the currently active network port configurations. (In OS X 10.1.x, these were called Active Network Ports, which is an easier name to say and remember, but I’m going to stick with network port configurations or active network interfaces since these are the hip terms now, it appears.) By choosing a network interface from the Show pop-up, you’re presented with various tabs that allow you to input various settings that are specific to that particular network port configuration. I stress the phrase specific to because this is where all that flexibility I talked about comes in. The TCP/IP settings for Ethernet can differ from the TCP/IP settings for AirPort, which can differ from the TCP/IP settings for modem connections.

In addition, which tabs show up differs for each type of port configuration. If you have an AirPort card, the AirPort configuration shows AirPort, TCP/IP, AppleTalk, and Proxies tabs. The tabs for a modem are PPP, TCP/IP, Proxies, and Modem. Ethernet gets TCP/IP, PPPoE, AppleTalk, Proxies, and Ethernet. So each type of network port configuration has its own group of settings.

Note

Although Mac OS X allows you to enable TCP/IP on multiple network ports simultaneously, it does not allow you to enable AppleTalk on multiple ports at the same time. Well, it may let you, but it won’t work, and you’ll probably get an error message telling you that AppleTalk can be active only on a single port.

In addition to providing the ability to switch between the settings screens for each network port configuration, the Show pop-up menu also includes two other items. The first, Network Status, provides you with a helpful display that shows a summary of your current network settings and the status of each. For each port configuration, you can see whether that port is active or inactive and whether it’s connected to a local network or to the Internet. (In the case of Ethernet and FireWire, it can even tell you whether or not a cable is connected to your Mac!) The summaries for some ports may even provide the IP address assigned to that port or (in the case of modem configurations) the phone number to be dialed. For example, on my computer, the Built-in Ethernet summary states Built-in Ethernet is currently active and has the IP address 192.168.1.2. You are connected to the Internet via Built-in Ethernet. (If you double-click any summary, you’ll switch to that network port configuration screen.)

The second additional item is called, curiously enough, Network Port Configurations. Choosing this item provides a list of all the active network interfaces included in the Show menu, as well as any inactive network interfaces (those that have been configured but disabled). Checking or unchecking the box next to a port configuration enables it or disables it, respectively. (An active port is available to OS X for use and shows up in the Show pop-up menu; disabling a network interface prevents it from being active and removes it from the Show pop-up menu.) For example, if you only connect to the Internet and a local network using an AirPort card, you can disable all the other port configurations (Figure 9.1). You can also create a new port configuration, or duplicate or delete an existing one, using the buttons on the right. Finally, you can rename a port configuration by double-clicking its name.

Figure 9.1: Using the Network Port Configurations dialog to disable unused network interfaces

Although you can probably think of a situation where you might need to create a new network interface (for example, after you’ve installed new networking hardware), you may be wondering why you’d ever want to disable, delete, or duplicate a port. The reason relates to the features I mentioned at the beginning of this section, port priorities and Locations.

Tip

If you have multiple ISP accounts, you can create a new modem configuration for each. For example, I have two modem configurations on my PowerBook, one called EarthLink Modem and another called SBC Modem. I can quickly connect to either of these accounts using the modem status menu or the Internet Connect application.

Understanding and Using Network Port Priorities

As should be clear by now from the discussion, you can create multiple network port configurations, and they can all be active at the same time; in network geek-speak this is called multihoming. However, in addition to being able to use multiple network configurations simultaneously, Mac OS X also has the impressive (and impressively useful) ability to prioritize them. In other words, not only can you enable TCP/IP on your Ethernet port, internal modem, and AirPort card at the same time, you can also tell Mac OS X which one you want to use as your primary connection, your secondary connection, etc. In fact, you can have as many network port configurations active—or more—as you have available network ports. When you do something that requires a TCP/IP connection (check your e-mail, access a Web page, connect to a remote server), OS X will try to connect using your first TCP/IP-enabled network interface. If that fails, it will try the second, and so on, until it either makes a successful TCP/IP connection or gives up after trying them all.

The way you prioritize network port configurations is so obvious and simple that it’s…well, not really obvious. In Network preferences, you go to the Network Port Configurations dialog (from the Show pop-up). Then you just drag each port configuration up or down. The port you move to the top of the configurations listing is the first to be used, and so on down the list. Yes, it’s really that simple. (OK, so you have to click Apply Now after making changes. But it’s still pretty easy.)

As an example, my desktop Mac normally uses DSL (via Ethernet) to connect to the Internet. However, sometimes my DSL provider is, shall we say, less than reliable. So my backup is a dial-up connection. I have two network port configurations active, Ethernet and Internal Modem, and Ethernet is first in the priority listing. Whenever I try to access the Internet, my Mac first checks the DSL connection; if that works, my Mac connects using DSL. If not, it automatically dials up my ISP via the phone line.

Note

Although the idea behind port priorities is very cool, and most of the time the system works great, sometimes it doesn’t. Sometimes OS X will try your first port configuration, and if that connection doesn’t work, it just sits there— it doesn’t even bother to try the next configuration. In situations like this, you can try to rearrange port configuration order or enable/disable various port configurations. However, an easier solution is to use Locations, discussed in the next section.

Using Network Locations

If your Mac never leaves home, you may never need to change your network settings. However, for many users (especially iBook and PowerBook users) this isn’t the case. You may use different network settings at home than you do at work; or you may travel between a number of places—work, home, friends’ homes, relatives’ homes, hotels—each of which has its own network setup. You could manually enable/disable network port configurations, or change settings, whenever you move, but that would be a hassle (and the more places you use your Mac with different network settings, the bigger a hassle it would be). A better solution is built into Mac OS X: Network Locations.

A Network Location is a group of network port configurations and their settings. You can have as many Locations as you want, and easily switch between them as you need. In fact, you already have at least one Network Location, as OS X created the very first one when you first set up your Mac for Internet access. It was called Automatic, and you can see it at the top of the Network pane of System Preferences in the Location pop-up menu.

Setting up Locations is fairly easy, and switching between Locations is even easier. To create a new Location:

  1. From the Location pop-up menu, choose New Location…

  2. Name your new Location, and then click OK.

  3. Make sure the new Location is selected from the Location pop-up menu, and then configure your network preferences for the new Location. Add/remove/enable/disable network inter- faces, enter the settings for each interface, and prioritize them as needed.

That’s all there is to it. Repeat the above process for each new Location you want to create.

Tip

In OS X 10.3 or later, you can also create a new Location by clicking the “Assist me…” button in Network preferences. This launches the Network Setup Assistant, which provides an excellent step-by-step interface for inputting your network settings.

If you want to create a new Location that’s based on or similar to an existing Location, choose Edit Location… from the Location pop-up menu, select the Location you want to use as a model, click the Duplicate button, and then give the copy a new name. You can then choose the new Location from the pop-up menu and edit it as needed. You can also use the Edit menu item to delete or rename existing Locations.

Once you’ve got your Locations set up, you can switch between them—and thus change your network settings—by simply choosing a Location from the Location pop-up menu and then clicking the Apply Now button at the bottom of the Network preferences window. But there’s an even easier way: Instead of opening System Preferences every time you want to change Locations, Mac OS X’s Apple Menu has a convenient Location sub-menu. Choose Location Ø Location Name, and OS X will make the change for you. Your new settings take effect immediately.

To give you an idea of the flexibility that the combination of port priorities and Network Locations provide, I have the following Locations defined on my PowerBook:

All Off All network port configurations are disabled. (See “Extend Battery Life Using Locations,” below, for why I do this.)

AirPort Home AirPort is the only active connection, and AppleTalk is enabled. I get both

Internet and local network access via AirPort. I use this when I’m not near my desk.

AirPort Travel The only active port is the AirPort card, and AppleTalk is disabled. I use this

Location when I’m accessing the Internet via a wireless access point—in a coffee shop, at a conference, etc.

Ethernet DHCP Travel The only active port is Ethernet, AppleTalk is disabled, and the Ether- net port is set to use DHCP for Internet access. This is the Location I use when connecting to broadband networks in hotels or other locations when I travel or do consulting work.

Modem Travel I’ve enabled a separate modem configuration for each of my ISPs. I’ve also edited the phone number list in Internet Connect (explained later in the chapter when I talk about the Internet Connect application) with phone numbers for the place(s) I’ll be visiting for each ISP.

I use this Location most often when I’m traveling and my only Internet access is via dial-up.

Granted, my setup isn’t typical, as most people don’t have the need for so many varied network setups. But isn’t it great to know you could do this if you wanted to do so?

Extend Battery Life Using Locations

If your iBook or PowerBook has an AirPort card, having the card active uses a good amount of battery power when you aren’t plugged into an AC outlet. In fact, even the modem uses some juice when you’re not using it. So it follows that disabling the AirPort card and/or the modem when you don’t need them will extend your battery life. You could enable/disable the AirPort card using the Internet Connect application or the AirPort menu item, but an easier approach is to create a new Network Location that has the AirPort and/or Internal Modem network interface(s) disabled (or even deleted). When you’re about to unplug, switch to this Location. I personally have a Location called All Off that has no active ports; I use this whenever I’m in transit or don’t need any network access. This approach also prevents your modem from trying to dial up when OS X doesn’t find a network.

Using Mac OS 9–Like Locations in Mac OS X

If you used Mac OS 9 or earlier, especially on a PowerBook, you’re probably thinking that OS X’s Locations are similar to “locations” using OS 9’s Location Manager. However, OS X’s Locations only apply to network settings, whereas OS 9’s Location Manager also controlled things like default printers, time zones, startup files, and more.

If you miss OS 9’s ability to control these other settings when you change locations, you’ll appreciate the shareware Location X (http://homepage.mac.com/locationmanager/). Location X works with OS X’s Locations functionality, but it adds the ability to also change settings for QuickTime, the time zone, Energy Saver, the default printer, and sound volume. It also lets you run AppleScripts and shell scripts when you change Locations, and you can use it to change your preferences for Apple’s Mail or Microsoft’s Entourage e-mail clients, as well. Location X even supports third-party plug-ins; developers can provide their own add-ons to allow Location X to switch settings for other applications and utilities.

Location X runs as an application; the first time you launch it, it creates its own locations based on the Locations you’ve set up in Network preferences. By selecting a location and then clicking the Show Detail button, you’ll see the current settings Location X is set to change for you (Figure 9.2).

Figure 9.2: Location X changes various settings when you switch “locations”

To add specific settings to be changed with the current location, choose them from the “Add option…” pop-up menu. (Before you make any changes, you should click the padlock icon to authenticate since some of the changes you’ll be making will require admin access; provide your admin password when prompted.) You can also select an existing setting and click the Configure… button. In either case, you’ll be allowed to edit your configuration for that setting. For those settings set in System Preferences, Location X will open System Preferences for you; make the appropriate changes and then switch back to Location X—the current settings will be restored when you’re through. (The same is true for Apple’s Mail; Mail will be launched, and you should then configure it for the location in question. Once Location X has “captured” those settings, it will restore your Mail preference to their original state.) For Microsoft Entourage, Energy Saver, and a few other types of settings, Location X will provide its own settings dialog; for those settings that require a simple menu selection or slider (Network, Default Printer, and Sound Level), Location X will present a pop-up menu. Finally, for AppleScript or Shell Script, Location X will present you with a dialog window; you can either drag the appropriate script to the window or use the Add… button to navigate to it.

You can also configure settings—for all but the AppleScript and Shell Script options—by manually changing them using Network preferences, Sound preferences, QuickTime preferences, etc. and then clicking the Capture… button in Location X. All the current settings will be saved to this location in one fell swoop.

Start Sidebar
IP over FireWire

I mentioned earlier that at the time of this writing, networking over FireWire is still quite rare. However, because IP (Internet Protocol) networking over FireWire is much faster than most of the other connection methods used for networking, it’s a very cool technology, so I’m going to talk about it a bit. In fact, FireWire’s theoretical data transfer speed is about 40 times faster than standard 10BaseT Ethernet and Air- Port, and about 4 times faster than 100BaseT Ethernet. So if you network your Macs together using FireWire, your network will scream.

Using FireWire networking between two Macs is actually quite easy. First, you need to make sure your Macs have IP over FireWire support. If you’re running OS X 10.3 or later, it’s already included; if you’re running OS X 10.2 or earlier, you need to download it from Apple’s website. Then open Network preferences on both computers and make sure FireWire is listed as a Network Port Configuration. If not, add a new one using the instructions I provide in the main text (“The Network System Preferences”); choose FireWire as the port. Then in the Network Port Configurations window, drag the FireWire configuration to the top of the list. (As explained in the main text, this ensures that your Mac will try to use FireWire networking first, and if it can’t use it for a particular task, it will use the second configuration, and so on.)

Next, connect two Macs together using a FireWire cable (you can also use two FireWire cables and a FireWire hub, if that’s your setup). You can now connect from one computer to the other for File Sharing or any other type of networking. (If you’re not sure how to use File Sharing, I talk about it in the next chapter.) In fact, if you have just a small home network, this is probably the ideal network setup because the data transfer speeds are so much faster than Ethernet or AirPort.

(You can even share your Internet connection with another Mac over FireWire; however, at the time of this writing the procedure is fairly complicated as it’s still in the testing process. I hope that by the time you read this, Apple will have instructions on their website, or even in your Mac’s Help.)

End Sidebar

You can add new locations in Location X by clicking the Add button or choosing Location Ø Add. (Whereas the first time you run Location X it creates its own location for every Network Location, on subsequent launches simply uses its own group of locations. In other words, if you create a new Network Location in Network preferences, Location X will not automatically create a corresponding location of its own; you’ll have to create one yourself.)

You can switch between Location X’s locations by selecting a location and then clicking the Make Active button (or choosing Location Ø Make Active). If you’ve enabled the Location X Menu in the preferences dialog, you can also switch locations even when Location X isn’t running. If any changes require admin access, you’ll be asked for your admin password (unless you’ve set Location X to never require a password). After that all your settings will change to reflect the new location (including the Network Location, if applicable). This is a great way to quickly change your Mac’s settings.

Copying and/or Backing Up Network Preferences

If you want to make a backup copy of your network preferences (a good idea, although you should be backing up much more than just your network preferences—see Chapter 14), the procedure varies depending on your version of Mac OS X. Whichever procedure you use, copy the preference file to a safe location.

Mac OS X 10.3 or later In OS X 10.3 or later, the Network preferences file is located at /Library/Preferences/SystemConfiguration/preferences.plist.

Mac OS X 10.2 or earlier In versions of OS X prior to 10.3, the preferences file is located in the hidden directory /var/db/SystemConfiguration. The easiest way to access this directory is to open a new Finder window, choose Go Ø Go to Folder…, type the path I just showed you, and then click the Go button. The file that contains your network preferences is called preferences.xml.

In addition, if you’re setting up a new Mac that will use many of the same network settings as your old Mac, you can copy the network preferences file to the appropriate location on the new Mac. (Under OS X 10.2 or earlier, you’ll need root access or a utility such as File Buddy that you can open as root using Pseudo or Snard, as discussed in Chapter 1.) The new Mac will then have the same network preferences as the original Mac. (Note that if you’re moving a network preferences file from a Mac running OS X 10.2 or earlier to a newer version of OS X, you’ll need to change the name of the file from preferences.xml to preferences.plist.)

The .Mac System Preferences

User Level | any
Affects | individual user
Terminal | no

The .Mac pane of System Preferences is where each user provides their .Mac member name and password and configures and monitors their iDisk. The preference pane is divided into two tabs: .Mac and iDisk.

.Mac

If you have a .Mac account (http://www.mac.com/), the .Mac tab is where you enter your member name and password. Your Mac uses these settings in a few different ways. First, if your main e-mail account is your .Mac account, your e-mail client may be able to use this information to automatically configure your e-mail account settings. (Apple’s Mail application is a client that offers this functionality.) Second, the iDisk tab (discussed in a moment) uses these settings to access your iDisk. Finally, if you use the Finder’s Go Ø iDisk Ø My iDisk command to access your iDisk, these settings are used to indicate the name of the iDisk and its password.

Note

You can access other iDisks (other members’ iDisks, or your own if you have multiple .Mac accounts) using Apple’s iDisk Utility or via the Finder’s Go Ø iDisk menu options. In the next chapter, I’ll also show you how to keep “bookmarks” for multiple iDisks.

iDisk

In Chapter 7, I covered the iDisk Utility. The iDisk tab of .Mac preferences (Internet preferences in OS X 10.2 and earlier) contains two groups of options (iDisk Storage and Your Public Folder) that are identical to those in the similarly named tools of iDisk Utility. iDisk Storage shows you the current usage and capacity of your iDisk, using the member name and password entered in the .Mac tab of .Mac preferences, and allows you to “Buy More” if you need it (connecting you to Apple’s .Mac website to do so). The Your Public Folder section lets you change the permissions for the Public folder on your iDisk. (These permissions—Read Only or Read & Write—apply to other users, not you; you always have full read/write access to your iDisk.) In addition, if you want to further secure your Public folder, you can enable a password; when enabled, other users will be required to enter this password to access your iDisk’s Public directory.

Under OS X 10.3 and later, there’s another option in the iDisk tab called “Create a local copy of your iDisk.” I cover this option in Chapter 11.

Tip

If you’re interested in learning more about .Mac and how to use it, you may want to check out my e-book, Take Control of .Mac, available from http://www.tidbits.com/takecontrol/.

Start Sidebar
Panther vs. Jaguar: Internet Preferences

The tabs found in OS X 10.3’s .Mac preference pane, mentioned in the main text, are in OS X 10.2 parts of a more comprehensive preference pane called Internet. In addition to the .Mac and iDisk tabs, which function just like their newer counterparts, the Internet pane also contains two other tabs—E-mail and Web— for Internet-related services.

The E-mail tab has two sections, one for choosing your preferred e-mail client, the other for choosing a default e-mail account. The setting for your preferred e-mail client is used when Mac OS X receives a request to send an e-mail. For example, if you click an e-mail link on a Web page, OS X will open the e-mail application selected here and create a new message addressed to the correct recipient.

Users of OS X 10.3 may be wondering where this e-mail client setting has gone. The answer is that Apple has moved it to the preferences dialog of the Mail application. So if you want to use an e-mail client other than Mail, you still need to launch Mail at least once in order to designate your preferred client.

The Web tab of 10.2’s Internet preferences lets you choose your default browser behavior. The Default Web Browser is the browser Mac OS X will launch (or open a new page in, if it’s already running) when you click a URL link in an e-mail message, text document, or any other application. It’s also the application that will be used if you double-click a Web Location file in the Finder. (I talk more about Web Location files later in this chapter.) The Web tab also provides settings for Home Page and Download Files To. If your browser supports Apple’s Internet preferences system, these settings tell your browser what page to go to when you click the browser’s Home button or choose Home from its menus, and where files should go when you click a link on a Web page to download a file, respectively.

Like the preferred e-mail client setting, users of OS X 10.3 may be wondering where the Default Web Browser setting has gone. The answer is analogous—Apple has moved it to the preferences dialog of the Safari Web browser.

Note that you can also change your preferred e-mail client and Web browser settings using third-party software. (See “Accessing Hidden Internet Preferences” for details.) However, if you have a copy of the Internet pane of System Preferences (from another computer running OS X 10.2 or via the OS X 10.2 Install CD), you can actually still use it in OS X 10.3! Simply install it in the appropriate PreferencePanes folder, and the next time you launch System Preferences, it will appear and function just as it does in OS X 10.2. (It will actually replace the .Mac pane.)

End Sidebar

Accessing Hidden Internet Preferences

Most Web browsers have a section in their preferences dialogs for “helper” applications—applications used to deal with files and protocols that the browser doesn’t handle. For example, Internet Explorer has a setting that tells it what to do with downloaded files that end in .sit (StuffIt archive files) and what to do when the user clicks an FTP link on a Web page. Users of Mac OS 9 will remember that the Internet control panel actually allowed you to customize the settings for helper applications, and those settings were used not only by many Web browsers, but also by the OS itself—when you opened an Internet Location file or when you clicked an Internet address in a text document or e-mail message.

It turns out that Mac OS X has the same settings, but they’ve been hidden. Perhaps Apple will allow you to access them via System Preferences at some point in the future, but at the time of this writing the only way to get to them is to edit a fairly obscure XML file using a text editor…or install a third-party utility such as More Internet (http://www.monkeyfood.com/software/), MisFox (http://www.claussnet.de/misfox/misfox.html), or IC-Switch (http://flip.macrobyte.net/software/).

IC-Switch appears in the menu bar and lets you easily change your preferred e-mail, FTP, newsgroup, RSS, and Web client settings. More Internet and MisFox, on the other hand, are quite a bit more powerful; they provide access to settings for a number of additional helper applications. I prefer More Inter- net because of its excellent interface; once you install it, you can access it via System Preferences just like any other preference pane. In the More Internet window, you’ll see a list of protocols/file types on the left, and the application that will be used for the selected protocol or file type on the right (Figure 9.3). To change the chosen application, just drag your preferred application to the window; it will be assigned to the selected protocol or file type. You can also add new protocols or file types to the list, or remove or edit existing items, using the Add…, Remove, and Change buttons.

MisFox offers functionality similar to More Internet in its Protocol Helpers tab, but it also provides the ability to choose helpers based on MIME types, which can be useful for some Internet content, such as WAV or WMV files.

Figure 9.3: Using More Internet to assign applications to Internet protocols and file types

The Bluetooth System Preferences

Bluetooth is a wireless networking protocol that allows Bluetooth-enabled devices within range of each other (up to 30 feet or 100 feet, depending on the device) to communicate. Bluetooth is similar to the 802.11 (AirPort) wireless networking standards, but with two significant exceptions. The first is that Bluetooth is a low-bandwidth protocol; it can’t transfer nearly as much data as AirPort can. The second difference is that whereas AirPort is multi-device network protocol—you can connect your AirPort-enabled Mac to a large network of computers, printers, etc., and even to the Internet—Blue- tooth is a paired or direct technology. Rather than connecting a computer to a network, with Bluetooth you create a private network of two devices by connecting those devices directly with each other— you pair them. You can think of it this way: if AirPort is the wireless equivalent to Ethernet, Bluetooth is the wireless equivalent to a USB or serial cable.

Apple introduced support for Bluetooth in Mac OS X 10.1, but you had to install the software drivers separately. Beginning with 10.2, Bluetooth support is integrated into the OS. Some examples of Bluetooth pairings are: a mobile phone and a hands-free headset; a mobile phone and a computer; two computers; a computer and a printer; a computer and a keyboard; and a mobile phone and a PDA. Using these pairings, you can send data back and forth. For example, you can use your wireless phone as a modem, or, using Apple’s iSync utility, you can synchronize your Mac’s Address Book with your contacts on your Bluetooth-enabled wireless phone or PDA. The only requirement is that both devices be Bluetooth-enabled. In the case of phones, printers, and PDAs, Bluetooth capability will generally be built-in. In the case of your computer, at the time of this writing Apple has made Blue- tooth either built-in or an option on every new Mac model, portable or desktop. If you’re using an older Mac without built-in Bluetooth, you can buy a relatively inexpensive USB adapter that’s about the size of a piece of candy and gives your Mac Bluetooth functionality.

The Bluetooth pane of System Preferences is where you control how your Mac uses Bluetooth. It only shows up in System Preferences when your Mac has Bluetooth support built-in or a Bluetooth adapter attached.

The Settings tab is where you turn Bluetooth on and off and where you control the access level, security, and compatibility of Bluetooth connections. The Discoverable option, when checked, broadcasts your Mac’s presence over Bluetooth frequencies so that other Bluetooth-enabled devices within range can see it. If you uncheck this box, devices that have previously been paired with your Mac will still be able to connect to it, but others will not “see” it unless you specifically connect to them. The Require Authentication setting forces other Bluetooth devices to authenticate (using a password) before they can connect to your computer. The Encryption option encrypts all data sent over the Bluetooth connection so that anyone else in the area who might intercept it (using their own Bluetooth device) can’t use that data without your password. The Support Non-Conforming Phones option uses a less efficient connection that’s more compatible with older Bluetooth-enabled phones.

The option in 10.3 or later to “Allow Bluetooth devices to wake this computer” is useful if you want to be able to connect to your sleeping Mac from a Bluetooth device without manually waking your Mac up first. (However, note that not all Macs support this feature.) You can also choose to “Open Bluetooth Setup Assistant at startup when no input device is present.” This is an especially useful option if you use a Bluetooth keyboard or mouse that loses its connection—the Setup Assistant will help you locate it and re-pair it.

Finally, the “Show Bluetooth status in the menu bar” option provides a Bluetooth menu that lets you monitor Bluetooth connections and enable/disable discoverable mode and Bluetooth itself, as well as access several other Bluetooth-related options.

The File Exchange tab of Bluetooth preferences (called Receiving Files under some versions of OS X) lets you decide on the default behavior when another Bluetooth device attempts to send a file or data to your Mac and the location where accepted items will be placed. Under OS X 10.2.4 and later, it also includes a Bluetooth File Transfer section that lets you allow other Bluetooth-enabled devices to browse a particular folder on your computer. (I cover this option in Chapter 10.)

The Devices tab—present only in OS X 10.2.4 and later—lets you view paired and connected Bluetooth devices, disconnect devices and delete pairings, and pair with new devices. In addition, by clicking the Setup New Device button, the Bluetooth Setup Assistant launches and walks you through the procedure of configuring a Bluetooth phone or PDA for use with your Mac.

Using Bluetooth Devices

Once you’ve paired your Mac and another Bluetooth device, you can send data between them using various methods. If you’re using a Bluetooth printer, simply setting up the printer in Printer Setup Utility (Print Center under OS X 10.2) lets you use it whenever needed. In the case of a Palm PDA, the HotSync software takes care of most data exchanges.

If the device supports file transfers, you can also use Apple’s Bluetooth File Exchange (located in /Applications/Utilities/) to send files—just drag a file onto the Bluetooth File Exchange icon, and you’ll get a list of Bluetooth devices in range (if the desired device isn’t listed, click the Search button to force your Mac to re-scan for devices). Select the desired device, and then click the Send button to send the file. (I talk more about this functionality in the next chapter when I discuss sharing files via Bluetooth.)

If your Mac or PowerBook has Bluetooth capability (either built-in or using a USB Bluetooth adapter), and you have a Bluetooth-enabled cellular/wireless phone, you can actually use your phone as a modem. This is a very cool thing since it means you can connect to the Internet and download mail or surf the Web even if you’re far away from your home network or a telephone line. (Note that some cellular phones and service plans have both “voice” and “data” rates. You may even be able to set your Mac up to use your standard voice connection and airtime.) Although I don’t have space here to show you how, if you’re using OS X 10.2.4 or later, the Bluetooth Setup Assistant makes it fairly easy to set up.

Tip

If you have a Bluetooth-enabled mobile phone or PDA, you really have to try out Salling Clicker (http://www.salling.com/). It turns your phone or PDA into a remote control that you can use to control iTunes, iDVD, PowerPoint, or Keynote whenever you’re in range—fun at home and quite useful when giving presentations. In addition, it includes a "proximity sensor" that detects when your phone or PDA is in range of your Mac; it can run any AppleScript when your phone or PDA leaves the proximity of your computer, and another when it returns. For example, you can have a password-protected screen saver launch when you leave your office and then disappear when you come back!

The Internet Connect Application

The Internet Connect application serves four purposes: to initiate dial-up ISP connections, to initiate “Point-to-Point Protocol over Ethernet” (PPPoE) ISP connections, to connect to AirPort networks, and to initiate Virtual Private Network (VPN) connections. If your connection to the Internet is via DSL, cable modem, or another type of Ethernet connection, and your ISP doesn’t use PPPoE, you may have never even opened the Internet Connect application (unless you use its VPN feature to connect to an office network over your broadband connection). In fact, even if you use a dial-up or Air- Port connection, you may have never used Internet Connect if you have the AirPort and/or Modem status menus enabled in Network preferences since you can initiate your connections using those menus. Nonetheless, Internet Connect has a few useful features you may want to know about.

Note

Internet Connect assumes that you’ve already entered all of your settings and configured all of your network ports in Network preferences.

Using Internet Connect

If you only have a single network port configuration that requires a connection (modem, PPPoE, Air- Port, etc.), the Internet Connect window will simply provide you with the appropriate settings and controls for that type of connection. However, if you have multiple port configurations that require connections, the toolbar will show each type of network configuration as a separate icon; click one to change the window’s options to reflect that type of port configuration.

For example, if you choose any type of modem configuration, you’ll see the information you previously entered in the PPP tab of the modem settings in Network preferences. However, one nice bonus is that the Configuration pop-up allows you to select from, and set up new, configurations. These configurations are not network port configurations; rather, they’re sets of telephone numbers, ISP account names/passwords, and modem scripts. They allow you to connect to more than one ISP or dial-up number without having to create new network port configurations. If you chose not to save your dial-up password in the modem settings of Network preferences, you can enter it manually here before you connect. Clicking the Connect button will dial your ISP and connect you to the Internet. Once you’re connected, the Status area of the window provides your IP address, connection speed, time connected, and visible indicators of data being sent and received.

Note

Under OS X 10.2, instead of a Configuration pop-up, you’ll see a Telephone Number pop-up, which provides a list of all numbers you’ve used with that particular modem configuration. You can add (or remove) numbers from the list by selecting the Edit… item.

The PPPoE window looks almost identical to the modem version except for the fact that there’s no Configuration pop-up menu. The AirPort configuration, on the other hand, looks significantly different. You can turn your AirPort card on or off using the AirPort Power setting—as I mentioned earlier in this chapter, turning your AirPort card off is a good practice when you’re traveling with a laptop since it uses battery power—and the Signal Level meter lets you see how strong a signal your AirPort card is receiving. You can choose between multiple AirPort networks using the Network pop-up; if you choose a network that requires a password, you’ll be presented with a dialog asking for that password. Finally, by choosing Create Network… from the Network pop-up, you can create your own AirPort network, using your own computer as the base. You give your network a name and password, as well as a default channel, and other users will be able to connect to it. (If your network is getting a lot of interference, you can change to another channel to see if the signal improves.)

You can also use Internet Connect to create Virtual Private Network (VPN) connection screens. Choose File Ø New VPN Connection…, and in the resulting dialog, choose either the PPTP (Point to Point Tunneling Protocol) or “L2TP over IPSec” (Level 2 Tunneling Protocol) option, depending on the VPN server to which you’re connecting. (Your network administrator will be able to tell you which setting to select.) A new item called PPTP or L2TP will appear in the toolbar; click it to switch to the VPN screen and then enter the VPN server address, account name, and password. Click Connect to connect to the VPN. (Like the modem screens, you can also use the Configuration popup to set up configurations for multiple VPN servers.)

Note

I talk more about Virtual Private Networking in Chapter 11.

Finally, each of the various configuration screens of Internet Connect allows you to turn its respective menu item on and off; these menu items allow you to quickly connect and disconnect and also provide a visible status indicator of your connection.

If you click the Summary item in the toolbar, you’ll see all of your Internet Connect connection options in a single window, along with a Connect button for each (Figure 9.4). If you don’t need to change any configurations, this is a quick and easy way to connect.

Internet Connect has one other useful feature most users don’t know about: the connection log. This log, accessible by choosing Window Ø Connection Log, shows a complete record of all connection activity. By enabling “verbose logging” in Network preferences (from the PPP or PPPoE Options dialog), you can get even more detailed logging. If you’re having trouble connecting, or sustaining a connection, the connection log should be your first place to look for clues as to the cause.

Sharing Your Surfing Signal

I talk about most of the features in the Sharing pane of System Preferences in Chapters 10 (sharing files), 12 (sharing printing), and 13 (using OS X’s built-in firewall). However, one of the features of Sharing preferences, Internet Sharing, belongs here. Internet Sharing lets you share a single Internet connection (dial-up, broadband, etc.) between multiple local computers. It does this using network address translation.

Figure 9.4: Internet Connect’s Summary screen provides an “at a glance” look at your connection options.
Start Sidebar
Midnight (or Any Other) Rendezvous

In Mac OS X 10.2, Apple introduced a new technology called Rendezvous. Based on the Zero Configuration Networking (zeroconf) standard (http://www.zeroconf.org/), Rendezvous provides a way for you, the user, to set up a local network of devices—computers, printers, servers—without having to deal with IP addresses, complicated network setups, or obscure networking protocols. In effect, you connect two computers, and they’ll immediately be able to take advantage of each other’s services.

The beauty of Rendezvous is that it works over your existing network. Once you’ve got a network set up, if you go to the Sharing pane of System Preferences you’ll see a note that reads Other computers on your local subnet can reach your computer at RendezvousName.local. RendezvousName is the name other users will see when they connect to your computer via Rendezvous; you can change it, if you like, by clicking the Edit… button in Sharing preferences. (In OS X 10.2, you change this setting via the Rendezvous Name field.) Plug your Mac into a local area network, and without any further ado you can see other Rendezvous-enabled devices, and they can see you. In fact, even if you don’t set up any other networking preferences, Rendezvous works great; you can simply connect two Macs using an Ethernet cable and they will communicate perfectly, allowing you to chat, share files, share printers, etc.

Although most of the services that you’ll take advantage of using Rendezvous are sharing services—Personal File Sharing, Windows File Sharing, Printer Sharing—that I’ll be talking about in the next few chapters, I mention Rendezvous here because it also works for things like iChat (which has its own Rendezvous buddy list) and iTunes (which lets you share/access music libraries).

How Does Rendezvous Work?

If you’re curious, what’s really happening behind the scenes is the following. When you connect to a local network, you computer picks an IP address for itself, chosen from a subnet that has been allocated for zero- conf networking by the Internet Assigned Numbers Authority (IANA). This IP address is in addition to any IP address your computer may already have been assigned for Internet access, and is an internal address (meaning that it is only used on the local network and can’t be accessed by computers not on that local network). Your computer then sends out a query using the Address Resolution Protocol (ARP) standard to see if any other device on the subnet is already using that address. If so, your Mac chooses another address and sends another query, and so on. Once it’s found an unused IP address, it grabs that address as its own.

After staking a claim on a local IP address, your computer then assigns its Rendezvous name (the one in Sharing preferences) to that local IP address. It does this using the same Domain Name System (DNS) protocol that’s used to assign domain names to IP addresses (e.g., why you can type cnn.com instead of the CNN Web server’s IP address). In fact, you’ll notice in the Sharing pane of System Preferences that your Rendezvous Name field includes the text .local. The .local domain has been assigned to Rendezvous, so any Rendezvous-enabled devices are given domain names based on the .local domain—your computer is simply RendezvousName.local. You’ll see in Chapter 12 that when you share a printer, its Rendezvous name will be an extension of your computer’s name: PrinterName@RendezvousName.local. The main difference between Rendezvous names and "true" DNS names are that, again, Rendezvous names are used only on your local network, so your Mac doesn’t have to query one of the Internet’s DNS servers to resolve the name of another local Mac into an IP address.

Rendezvous Connection Caveats

A couple of caveats about Rendezvous: First, as I mentioned, Rendezvous is used only for devices located on a local network; for another user to see your computer using Rendezvous, they have to be connected to the same local network as you. In fact, they have to be connected to the same subnet of your local network. (A subnet is a subsection of a local area network, designated/delineated by a network administrator; if you’re connected to a simple network in your home or small office, this restriction won’t affect you at all. If you’re connected to a large LAN with multiple subnets, it just means that Rendezvous will work only for other devices connected to the same subnet.)

Second, Rendezvous has some built-in security measures that are intended to prevent network security breaches; these measures may prevent certain Rendezvous devices—specifically, those devices that don’t follow the Rendezvous guidelines precisely—from working. If you find that certain Rendezvous-enabled devices don’t appear when they should, open Terminal and type sudo sysctl-w net.inet.ip.linklocal.in. allowbadttl=1 <RETURN>; provide your admin password when prompted. If this fixes the problem, the cause is a not-fully-Rendezvous-compliant device. (You should contact the manufacturer to see if they have a more permanent fix; if they don’t, you’ll have to type this command each time you restart since it only "fixes" the problem until shutdown.)

End Sidebar

Network Address Translation Translated

When you connect to the Internet via your ISP or your business’ or organization’s network, your computer is usually assigned an IP address that uniquely identifies it to the rest of the Internet. This IP address is very much like a street address for postal mail—anything you send out has your return address so that the recipient knows exactly where to send replies. When you connect to a Web server, for example, and request a Web page, your IP address tells the server exactly where to send that page for viewing. Since most ISPs only provide you with a single IP address, you can’t connect multiple computers to the Internet at the same time by entering the same IP address in Network preferences on all of the computers—if you tried, whenever one of them requested data from the Internet, all of them would receive that data (since they’d all have the same IP address).

The solution to this problem is to employ an Internet router that provides network address translation (NAT). The router itself takes on the actual IP address assigned by your ISP, and then provides internal IP addresses to each connected computer. (Internal addresses are a specific range of IP addresses that uniquely identify computers on a local network; they don’t really mean anything on the Internet and can’t be used to communicate via the Internet without an Internet router in between.) The router then translates traffic from your computer to the Internet (so that the data appears to come from your ISP-assigned IP address), and from the Internet to your computer (so that requested data finds its way back to your computer, instead of one of the other computers being managed by the router).

To further the “street address” analogy, an Internet router is like the mailroom at a large company. To the post office, all mail is going to and coming from a single address; but the mailroom makes sure that outgoing mail gets out and that incoming mail gets forwarded to the correct recipient. By using an Internet router, multiple computers can access the Internet over a single connection, but to your ISP and anyone else outside your network, it appears as though only a single computer is online.

OS X’s Own Internet Router

Most Internet routers are hardware devices that provide routing services for broadband connections such DSL and cable; a few, such as Apple’s AirPort Base Station, also work with dial-up connections. Mac OS X actually includes a software router—based on the Unix program natd—that works with both broadband and dial-up connections. Called Internet Sharing in OS X, this router is set up via the Internet tab of System Preferences’ Sharing pane. Just as with a hardware Internet router, other computers on your network can take advantage of your Mac’s Internet connection via Ethernet or wireless (AirPort) connections, so a small home or office network of computers can easily share the same connection. If you want to take advantage of Internet Sharing, the following sections show you how to set it up and how to connect your other Macs to the Internet through it.

Enabling Internet Sharing
User Level | admin
Affects | computer
Terminal | no

If your computer is currently connected to the Internet and you want share your connection with other Macs, here’s how. These instructions apply to the computer providing the shared Internet connection:

  1. From the Mac that will act as the Internet router, connect to the Internet as you normally would, using your Mac’s internal modem or a broadband modem.

  2. Open the Sharing pane of System Preferences and click the Firewall tab. Make sure the firewall is disabled. (Alternatively, you could just open port 443 in the firewall, using the procedure described in Chapter 13.)

  3. Switch to the Internet tab of Sharing preferences. From the “Share your connection from” popup menu, choose the network port you’re currently using to connect to the Internet. Then, in the “To computers using” box, enable the ports over which you want to share that connection.

    3.A If you’re going to be sharing your connection over AirPort, click the AirPort Options… button. In the resulting dialog, enter a name for the AirPort network you’re about to create. If you want to choose a particular AirPort channel, choose it from the pop-up menu; most users should leave it set for Automatic. Unless you want anyone within 100 feet or so to be able to hitchhike on your connection, check the “Enable encryption (using WEP)” box; provide a password (twice to confirm it), and then choose 128-bit from the “WEP key length” pop-up menu. Click OK to create the new network. Note that to share your Inter- net connection over AirPort, “Allow this computer to create networks” must be enabled in the AirPort tab of the AirPort configuration in Network settings. Also note that you can’t share an Internet connection via AirPort if your computer is actually getting its Inter- net connection via AirPort.

  4. Click Start to start the natd (Internet Sharing) service.

Internet Sharing is now enabled and running; to connect other local computers to your network, see the next section.

Note

If you change your Network Location while Internet Sharing is enabled, you’ll need you stop Internet Sharing and then start it again for other computers to be able to share your Internet connection. Also, keep in mind that if your Mac is asleep, it can’t share its connection—make sure you set it to “never” sleep via Energy Saver preferences.

Connecting to Internet Sharing on Another Mac
User Level | admin
Affects | computer
Terminal | no

If you’ve set up Internet Sharing and want set up other Macs to use your Internet connection, or if you need to set up your own computer to access Internet Sharing on another Mac, here’s how. These instructions apply to the computer accessing the shared Internet connection, not the one sharing it:

  1. Open the Network pane of System Preferences. (If the computer already has networking settings, create a new Network Location, as explained earlier in the chapter; you don’t want to wipe out the existing settings.) Proceed to the Step 2, below, that corresponds to the type of connection used to communicate with the Mac providing Internet Sharing.

Via Ethernet

  2. In the Network Port Configurations dialog, make sure Ethernet is listed at the top of the active port configurations. Then choose the Ethernet port from the Show pop-up menu.

  3. Click the TCP/IP tab, and then choose Using DHCP from the Configure pop-up menu.

Click Apply Now to activate the new settings.

Via AirPort

  4. In the Network Port Configurations dialog, make sure AirPort is listed at the top of the active port configurations. Then choose the AirPort port from the Show pop-up menu.

  5. Click the TCP/IP tab, and then choose Using DHCP from the Configure pop-up menu.

  6. Click the AirPort tab, and then make sure “Show AirPort status in menu bar” is enabled. Click Apply Now to activate the new settings.

  7. From the AirPort menu in the menu bar, choose the network’s name (this is the name given to the AirPort network when Internet Sharing was started on the other computer); enter the network’s password when prompted.

You should now be able to use the Internet via the computer providing Internet Sharing. Of course, this means that you can only access the Internet when that computer is on and connected.


Better Browsing Basics

I’ve spent most of this chapter helping you get the most out of your network/Internet settings and connections. I’d like to spend the rest of it talking about Web browsing; although it’s probably the most popular use of the Internet, it’s also one of the areas where users generally work the same way they did when they first starting surfing. The sections that follow will help you browse better. (These tips are fairly general and should work with any Web browser.)

Note

Unless otherwise noted, the tip table for the remaining sections of this chapter should be as follows: User Level, any; Affects, individual user; Terminal, no.

Surfing with ICeCoffEE

User Level | normal or admin
Affects | individual user or computer
Terminal | no

You surely get a lot of your URLs right from Web pages—you see a link and click it. But how often do you find URLs in e-mail messages, text documents, application “About” boxes, or other sources besides Web pages? Probably fairly often. If you’re lucky, your e-mail client lets you click a link to open it in your browser, but some don’t. On top of that, what about all those URLs that are in text documents, dialog boxes, and the like?

Mac OS 9 and earlier had a clever third-party extension called ICeTEe that allowed you to command-click a text URL to open it in your browser. Nicholas Riley has brought the same functionality to OS X via his freeware ICeCoffEE (http://web.sabi.net/nriley/software/). After installing ICeCoffEE and then logging out and back in, you’ll be able to command-click URLs in Cocoa (and some Carbon) applications to open those URLs. I probably use this feature 20 to 30 times a day! The only drawback is that applications that haven’t been updated to use OS X’s text engine generally don’t work with ICeCoffEE.

An added bonus of ICeCoffEE is that it can add a Services menu—that includes access to all Services, not just ICeCoffEE—to contextual menus and can even add a new Services menu to the menu bar. Although you could just as easily highlight some text and then go to the Services menu in the Application menu, having it in contextual menus or the menu bar is a nice feature.

Note

I discuss Services in detail in Chapter 7.

Simple (and Slick) Searching

One of the most frequent activities people do when surfing the Web is to search for things: information on Google, products on eBay, news, software updates…if it exists, someone’s trying to find it. Yet the average search goes something like this: Launch or switch to your Web browser, type in the search engine URL (or, if you have the site bookmarked, select the bookmark), type in your search term(s), then wait for the results. It’s not too big of a deal, but what if you could just press a key and type in a word or two, and everything else was automatic?

Just as it’s true that if something exists, someone’s trying to find it, it’s also true that no matter how few steps it takes, someone wants fewer. The result is a plethora of “search assistance” utilities that make searching the Web easier. I used to think these utilities were, well, a bit silly…until I found one that was both unobtrusive and powerful. This gem is the simple and elegant shareware utility iSeek (http://www.ambrosiasw.com/utilities/iseek/). iSeek exists only in the menu bar; if you click its icon or press command+option+/ (or the keyboard shortcut you choose), a small text field appears (Figure 9.5). Type the text to be searched and hit return, and your Web browser opens to the results of the search. You can choose the site to search—many, many sites are supported—from the popup menu (which looks like a magnifying glass) to the left. In addition, if you know the syntax of an unsupported website’s search engine, you can add it to the list via iSeek’s preferences. (A large number of user-submitted iSeek search sites are available online at http://www.ambrosiasw.com/utilities/iseek/weblinks.html.)

Figure 9.5: iSeek lets you search many different sites and search engines quickly and easily.

Reading over what I just wrote, it may not seem like a lot of time or effort saved, but it really is. In writing this book I used Google or VersionTracker several times each hour to find the URL for a piece of software. The procedure used by iSeek—press command+option+/, type a few words, press return—is much faster than the typical search steps. Not to mention better on the hands and wrists.

Tip

Speaking of search engines, a hidden gem is Google’s Mac-specific search: http://www.google.com/mac. For some other neat but little-known Google tricks, check out http://www.google.com/help/features.html.

Browsing the Browsers

At the time of this writing, Mac OS X comes with two Web browsers—Apple’s own Safari and Microsoft’s Internet Explorer—pre-installed, with Safari selected as the default browser. Although both are excellent browsers (and Internet Explorer still provides the best compatibility with websites designed for the Windows version of Internet Explorer), along with the growing popularity of Mac OS X has emerged a growing number of alternative browsers. I would be remiss if, in the midst of all the ways I encourage you to get more out of your Mac, I didn’t also encourage you to explore alternative Web browsers. There are currently at least seven viable alternatives to Safari and Internet Explorer—browsers that you could feasibly switch to for all your surfing activities. None of them offer the same feature sets as Safari or Internet Explorer, but they compensate by offering different interfaces and, sometimes, additional features such as content filtering. These browsers are:

  • Camino (formerly Chimera): http://www.mozilla.org/projects/camino/, free.

  • iCab: http://www.icab.de/, shareware.

  • Mozilla: http://www.mozilla.org/releases/, free.

  • Firefox: http://www.mozilla.org/products/firefox, free.

  • Netscape: http://channels.netscape.com/ns/browsers/, free.

  • OmniWeb: http://www.omnigroup.com/applications/omniweb/, commercial.

  • Opera: http://www.opera.com/, commercial.

If you’re curious, download a few of these browsers and give them a try; they’re each unique in their own way, and all of them give Safari and Internet Explorer a run for their money. Even better, whereas Internet Explorer is officially discontinued, most of these alternative browsers are updated quite regularly—some weekly, or even nightly!

That being said, Apple’s own Safari is an excellent application and appears to be taking the crown of “browser of choice” for many Mac users. (It’s definitely become my favorite.) It’s fast, it’s stable, and it has a great—and familiar, if you’ve used any of Apple’s iApps—interface. It also has a few unique features, such as a built-in search tool, the best bookmarks system of any browser, in my opinion, and built-in Rendezvous support—local Macs with Personal Web Sharing enabled (see Chapter 10 for more info on Personal Web Sharing) will show up in Safari’s Rendezvous list as Rendezvous bookmarks. In addition, Apple has worked hard at making Safari as compatible as Internet Explorer so that we Mac users don’t have to feel like second-class citizens when trying to access online banking and other Windows-oriented Web services.

Safari is also quite customizable, with more than 50 utilities for Safari available at the time of this writing, and more being released each week. Browse over to http://www.versiontracker.com/macosx/ or http://www.macupdate.com/ and do a search for safari, and you’ll get more results than you know what to do with. In addition, Apple has provided a number of Safari-enhancing Apple- Scripts at http://www.apple.com/applescript/safari/.

Tip

To see a list of Safari’s keyboard shortcuts (there are lots of them), control/right-click the Safari icon in the Finder, and then choose Show Package Contents from the resulting menu. Navigate to /Contents/Resources/Shortcuts.html. Drag this file onto the Safari icon in the Finder or the Dock to open it in Safari; to keep it handy, add it to your Safari bookmarks. (What you’re actually doing is creating a link to one of the Safari Help files, but this bookmark is much faster than launching Help just to view keyboard shortcuts.)

Take Advantage of Tabs

Quick question: How often do you open multiple Web browser windows or use the forward/back buttons to switch between multiple sites or pages? Chances are, pretty often. Because these actions are so common, one of the most popular Web browser features has become tabbed browsing. If you’re a Web expert, you know all about tabbed browsing; however, many people have never used it, even though their browser supports it. With tabbed browsing enabled (usually via your browser’s preferences dialog), you can open multiple Web pages within the same window. Each window gets its own “tab” at the top of the main browser window (Figure 9.6). I have my Safari preferences set so that command- clicking a link on a Web page opens it in a new tab behind the tab I’m currently viewing. You can even set up groups of bookmarks in Safari’s Bookmarks Bar so that clicking a group and choosing “Open in Tabs” will open each bookmark in the group in a new tab within the current browser window. This is a great feature for quickly opening your “daily” Web favorites each morning.

Click To expand
Figure 9.6: Tabbed windows in Safari

Location Files, Part I

If you’ve ever downloaded software (freeware, shareware, etc.), chances are you’ve seen a file that says “Visit the website!” or something like that. Double-clicking that file opens the company’s website in your Web browser. This is a nice trick for the software developer, but these kinds of files, called Inter- net Location files, are easy to create and use yourself. (Although the names are similar, don’t confuse Location files with Network Locations, discussed earlier in the chapter.)

You can create a Location file several ways. The first is to drag a link/URL from a page in your Web browser to the Finder (the Desktop, a folder, etc.). A Location file will be created that, when double- clicked, will point your browser to that URL. This is a simple way to create a Location file for a site you haven’t yet visited. The second method is to highlight the URL of the current page in your browser’s address bar and then drag it to the Finder. (If the site provides an icon in the address bar—officially called a favicon—you can drag that instead.) This is the easiest way to create a Location file for a page you’re currently viewing. (Unfortunately, this doesn’t work in Microsoft’s Internet Explorer. In Explorer, you need to control/right-click the link, select Copy Link to Clipboard, and then paste the URL into an application such as TextEdit; then use the procedure described in the next paragraph.)

The third way is to highlight a URL in almost any text field—a text editor, an e-mail client, a word processor, a text field in a browser window—and then drag that highlighted text to the Finder. OS X will automatically create a Location file for you. This is a great way to create a Location file when you find a URL in a ReadMe file or an e-mail message that you want to look at later. (Sadly, this won’t work in Microsoft Word since Word uses its own text engine that doesn’t fully support OS X’s drag-and-drop functionality.)

Tip

If you frequently visit a website that requires a username and password to access—not sites that have “account logins” on the Web page itself, but rather those that present a password dialog before you can even get to the website— you can actually include your username and password in a Location file. Open TextEdit and type the URL in the following format: http://username:password@domain, where username and password are the login name and password for the site, and domain is the URL you’d normally use to access the site (minus the http://, which is already included). Highlight the entire URL and drag it to the Finder to create a new Location file that automatically provides your password information to the Web server.

I use Location files all the time when I see a website or page that I want to come back to later but don’t want to add to my browser’s “permanent” bookmarks (e.g., a news article, an interesting site), or when someone sends me a URL to check out. I simply create a Location file on the Desktop, and it serves as both a temporary bookmark and as a reminder to go back and look at the website. However, you can also use Location files as an alternative to your browser’s bookmarks/favorites. I’ll talk about why you might want to do that in the next section.

Note

In case you’re wondering, “Location Files, Part II” is located in Chapter 11—you can quickly access file servers and remote volumes using them.

Better Bookmarks (a.k.a. Finer Favorites)

You probably use your Web browser’s bookmarks or favorites feature to bookmark sites that you visit often or to keep track of sites that you want to come back to later. However, you may not know that there are other ways to manage URLs besides the functionality built into your Web browser. Why wouldn’t you want to use your browser’s built-in abilities? One reason is that third-party book- mark utilities provide a lot more functionality. The other is that you may want to be able to access your bookmarks no matter which browser you use—if you can use your bookmarks from within any browser, you’re no longer tied to using a single one for fear of “losing” all those sites you’ve collected over the years.

Favorites from the Finder (and Dock)

The simplest way to have a universal set of bookmarks is to use Internet Location files as described in the previous section. Create a folder in the Finder, call it Bookmarks or Favorites, and then create and/ or place Location files inside. If you drag this folder to the Dock, as I showed you in Chapter 5, you can quickly access its contents—in this case, bookmarks to your favorite websites—by control/rightclicking the folder in the Dock (Figure 9.7) and then selecting a Location file. You can even arrange your Location files into sub-folders. (Opening a Location file will open it in your preferred browser; if you prefer to use a different browser, most browsers also let you open Web Location files by dragging the files onto their icon in the Dock or into any open browser window.)

Figure 9.7: A homemade menu of bookmarks/favorites in the Dock

Managing Bookmarks Using URL Manager Pro

Although using Location files in the Dock is quick and convenient, it doesn’t offer a lot of functionality. If you’re a heavy user of bookmarks/favorites, and especially if you tend to use several different browsers, your new best (browsing) friend is going to be URL Manager Pro (http://www.url-manager.com/)— UMP for short. UMP lets you use any number of bookmark files, and lets you access those bookmarks from within any application, using its Dock menu (Figure 9.8). Selecting a URL from a bookmark file opens it in your preferred Web browser. (If you have multiple bookmark files, you can also open them from the Cabinet sub-menu.) Even better, you can add a bookmark from within any browser via the Dock menu; you can even add a note to the bookmark when you save it—I use this on URLs that aren’t very descriptive to help me remember what the site is. (A nice touch is that you can place the bookmark directly into a sub-folder of your bookmarks file by selecting the Add Bookmark item inside the sub-folder—a feature not available in most browsers.) You can even keep e-mail addresses in your UMP bookmark file; selecting an e-mail bookmark opens a new outgoing e-mail message, addressed to the chosen e-mail address, in your e-mail client.

Figure 9.8: URL Manager Pro’s Dock (left) and menu bar (right) menus

In addition to its Dock menu, UMP supports what it calls shared menus. These shared menus appear in the menu bar when a browser is active (or when any Internet-related application is active, if you prefer) and provide quick access to UMP’s features, as well as to any of your UMP bookmark files (Figure 9.8). The great thing about these shared menus is that selecting a Web bookmark from within a browser using UMP’s shared menus will open that Web page in the current browser, regardless of which browser is your preferred selection in Internet preferences.

If being able to use the same bookmarks in all your browsers isn’t enough, UMP also offers some great bookmark management tools. You can import bookmarks from your existing browser’s book- marks/favorites, and you can export your UMP bookmarks to text, HTML, or location files. You can upload your bookmarks file(s) to an FTP site so that you can access it from multiple computers. You can also sort bookmarks in a number of different ways, eliminate duplicate bookmarks, search bookmark URLs, titles, and notes…the list goes on and on. If you’re a Web addict, URL Manager Pro is one of the most useful utilities you can find.

Synchronizing (Bookmarks) Succinctly

What if you’re not as bonkers for bookmarks as I am, and you don’t need something as full-featured as URL Manager Pro? What if you just wish you could consolidate or synchronize your bookmarks/ favorites between browsers? The shareware Bookit (http://www.everydaysoftware.net/bookit/) is the answer for you. When you run Bookit, it asks you which browsers’ bookmarks you want to synchronize (it supports Camino, iCab, Internet Explorer, Mozilla, Netscape, OmniWeb, Opera, and Safari) and which is your default/preferred browser. It then opens a window with your default browser’s bookmarks in the main window—this will become your "universal" bookmarks file—and a list to the right of any bookmarks found in your other browsers that don’t exist in your default browser’s bookmarks (Figure 9.9). Clicking a bookmark on the right shows you the full URL, as well as which bookmarks/favorites file it comes from; drag it to the main window to add it to your main bookmarks file. (You can also create new folders, rearrange bookmarks and folders, and perform other organizational tasks on your main bookmarks file.)

Once you’re done consolidating and organizing all your browsers’ bookmarks, click the Write… button; you’ll be asked which browser(s) you want to use this new master bookmarks file with. Bookit will then create a new, updated bookmarks/favorites file for each of the browsers you select. You can also choose to write a Bookit file to be used by the Bookit Dockling or menu; the Dockling and menu let you access your master bookmarks file at any time from the Dock or the menu bar, respectively.

The only downside to Bookit is that it doesn’t automatically consolidate all your bookmarks/ favorites; you have to run it periodically and repeat the process described above. However, it allows you to use your browsers’ built-in bookmarks/favorites functionality, instead of a third-party book- mark utility, which some users find more convenient. If you don’t care about the extra features of something like URL Manager Pro, Bookit may serve your needs just fine.

Using a Local File (or Your Bookmarks/Favorites) as Your Home Page

Since my laptop isn’t always connected to the Internet, I prefer not to use the URL of a remote web- site as my home page—mainly because it isn’t always accessible, but also because if I have “Connect automatically when needed” selected in the modem configurationof Network preferences, every time I open my browser, my laptop tries to dial up my ISP. To solve this, I’ve created my own “home page” that’s simply an HTML file of my favorite links, as well as some text info that I tend to forget (such as my home computer’s IP address). I then enter the local address of this file in the Home Page field of my browser’s preferences dialog. (Another solution is to simply leave the Home Page field blank, which doesn’t load any page until you specifically enter a URL it the browser’s address field or click a URL in another application.)

If you’d like to use a local file as your home page, the easiest way to get its address is to use your favorite browser. Choose File Ø Open… (or File Ø Open File…, depending on the browser), and navigate to the local file. When you click the Open button, the file will open in your browser. More important, the file’s address will appear in the browser’s address bar. Simply copy it and then paste it into the Home Page field in your browser’s preferences. (As an example, the location of my personal home page document is file://localhost/Users/frakes/Documents/homepage.html.)

Click To expand
Figure 9.9: Bookit lets you synchronize the book- marks of all your browsers.

If you like this tip, but don’t want to (or don’t know how to) create your own “home page,” you might consider using your browser’s bookmarks/favorites file. (Your bookmarks/favorites are actually contained in a single file, created by your browser.) This is a nice option for people who tend to access their bookmarks frequently. To do this, use the procedure I just described, but select your browser’s bookmarks/favorites file. If you don’t know where this file is located, here are some hints:

iCab ~/Library/Preferences/iCab Preferences/Hotlist.html

Internet Explorer ~/Library/Preferences/Explorer/Favorites.html

Mozilla ~/Library/Mozilla/Profiles/default/bookmarks.html

OmniWeb ~/Library/ApplicationSupport/OmniWeb/Bookmarks.html

Unfortunately, if you use the Camino or Opera browsers, or Apple’s own Safari, you can’t use their bookmark files as your home page because they aren’t in HTML format. However, you can export your bookmarks to HTML format from within Camino and Opera, and then use the resulting file as your home page. For Safari, until Apple adds an Export command, you’ll have to use a third-party bookmark utility (such as Bookit, mentioned in the previous section) to convert your bookmarks to a standard HTML file. (Alternatively, you can open Safari preferences and set the “New windows open with” setting to Bookmarks; this will cause new Safari windows to be opened to the Bookmarks Library.)

Preventing Pop-Ups (Pop-Up Ads, That Is)

Many of the Web browsers available for Mac OS X have pop-up advertisement blocking built-in. In Safari, for example, just choose Safari Ø Block Pop-Up Windows, and you’ll no longer be bothered by pesky pop-ups.

However, if you’re still using Internet Explorer, you’re probably (painfully) aware that it doesn’t provide such functionality; when using IE, you’re at the mercy of Web advertising. Fortunately there are a couple solutions for IE users: Unpopular (http://www.rampellsoft.com/) and Pop-Up Zapper (http://www.batista.org/). These utilities even try to get around the Catch-22 of some pop-up windows containing "real" content: Pop-Up Zapper tries to block all pop-up windows unless you specifically tell it to allow them from certain domains or sites. Unpopular uses a database of known sites, updated regularly by the developers using feedback from users, to decide what to allow and prevent.

Use JavaScript Bookmarks to Automate Useful Actions

Nearly all modern browsers support JavaScript, which is a Web-oriented scripting language. Although I can’t teach you JavaScript in a few paragraphs, I can show you a couple examples of ways in which you can take advantage of JavaScript to automate some things you’re likely to do fairly often while surfing.

Get Your Browser Windows Back to Size

One problem that appears to affect all browsers is a tendency for windows to resize themselves. Whether this is due to pop-up ads or simply because you closed the last browser window and new ones open with the “wrong” size, it’s annoying when you browser windows aren’t the size you want them to be and you have to manually resize them.

If you find this as annoying as I do, here’s a trick that will save you some mousing about. In your browser, create a new bookmark, and name it something like Restore Window Size. For the URL of the bookmark, type javascript:window.resizeTo(1000,850)—the first number is the width of your preferred window size in pixels; the second is the height. (Adjust the numbers to your preference.) Whenever your browser window gets resized, select this new bookmark, and the window will be restored to your preferred size. (If you’re using Safari, you can add the bookmark to the Bookmarks Bar for quick access.)

Send the Current Website URL via E-mail

Something I do quite frequently is send website URLs via e-mail. Whether it’s an interesting site that I send to a friend or a work-related site that I send to professional colleagues, I do it often enough that I always wanted to be able to automate the process. After doing my JavaScript homework, I ended up coming up with something that worked pretty well. In your browser, create a new bookmark; I named mine Send URL. For the URL, type the following (continuous, without any spaces):

javascript:location.href=’mailto:?SUBJECT=’+document.title+’
&BODY=%3C’+escape(location.href)+’%3E’

Whenever you find a website you want to send to someone, select this bookmark—it will open a new e-mail message in your preferred e-mail client, with the subject being the title of the current website and the body being the URL. Simply provide a recipient and you’re done! Just like the previous example, I’ve actually placed this bookmark in the Bookmarks Bar in Safari.

Note

For a few more examples of JavaScript bookmarks designed specifically for Safari, check out http://www.apple.com/applescript/ safari/bookmarks.html.

Setting Up Servers

User Level | admin
Affects | computer
Terminal | possibly

Before moving on, I want to squeeze in a few quick notes about setting up more advanced Internet services on your Mac. In the next chapter I’ll talk about setting up Web and file servers; however, you should be aware that in addition to being a great desktop operating system, Mac OS X is also an industrial-strength server platform. It comes with built-in Web, mail, FTP, file, Telnet, SSH, and print servers. By activating these, or installing alternatives, you can turn your Mac into a real Internet powerhouse. Here are a couple articles and resources that can get you started:

  • Postfix Enabler (http://www.roadstead.com/weblog/Tutorials/ PostfixEnabler.html) is a helpful utility for enabling and configuring Mac OS X’s built-in Unix e-mail server, postfix. (If you’re running OS X 10.2 or earlier, you have a mail server called sendmail installed; you want Sendmail Enabler instead, available from http://www.roadstead.com/weblog/Tutorials/SMSource.html.)

  • Homemade Dot-Mac with OS X (http://www.macdevcenter.com/ pub/a/mac/2002/08/09/homemade_dotmac.html) is a tutorial for setting your Mac up to provide many of the same services available through Apple’s .Mac service.


Moving On...

Team LiB

Moving On…

Now that you’ve gotten some good tips on making network connections, it’s time to take advantage of them. The most common uses for network connections are Internet use, file sharing/access, remote access and control, and printing. I covered Internet use a bit in this chapter. In the next few chapters I’ll show you how to share files with others and access files on other computers, how to control your Mac remotely, and how to take advantage of Mac OS X’s impressive printing features.


Chapter 10: Stellar Sharing Strategies

(Or: All the ways you can share your files with others.)

Overview

It used to be that sharing files with other people meant copying those files to a floppy (or, if you were lucky, to a CD-ROM) and then handing (or mailing) the floppy or CD to the recipient. The growing popularity of high-speed Internet connections has changed all that, as most people can now use e-mail to send files back and forth. However, sometimes e-mail isn’t the best solution—very large files and shared files that multiple users need to work on are a couple of examples of files that aren’t well suited for e-mail—and not everyone likes filling up their e-mail inbox with files.

Luckily, Mac OS X is the most flexible OS on the planet in terms of its varied offerings for sharing files and data (generally called sharing; shared volumes or directories are often called shares). You can share files with other users of your computer, over a local network, and even over the Internet. What’s more, you often have multiple ways to share files with each group of people. In this chapter, I’ll cover all of the ways in which you can share files, starting with local sharing and then moving on to network and Internet sharing. For each method of sharing, I’ll make it clear what can be shared, who can and can’t access files, how to configure sharing, and how other users can access shared files. I’ll also show you how to go beyond the standard options provided by Mac OS X to make your Mac a supercharged sharing machine.

Tip

In this chapter I explain how other users can access your shared files; in the next chapter I cover how you can connect to shares on your own computer or other computers.

As you read this chapter, keep in mind that unless otherwise noted, “sharing” includes the ability to both read and write files. If you provide someone with access to a directory, they can not only read files within that directory, but they can usually copy files to that directory, as well. So sharing isn’t only a good way to provide access to files; it’s also a good way for others to give files to you.

Note

Most of the techniques for sharing files covered in this chapter require an Internet connection. I’m going to assume that you have Internet access and that you know how to connect to the Internet.

Warning

If you’re sharing files remotely (over a network or over the Internet), you’re opening up your computer to other users that you can’t see and whose identity you may not be able to verify. This means that if you enable any type of remote sharing, you should be sure that the users of your Mac have good passwords and that they change those passwords periodically; it also means you should consider some type of network/firewall security. I talk about these topics in Chapter 13.


Sharing Locally: The Public and Shared Folders, and Local Volumes

User Level | any
Affects | individual user
Terminal | no

The simplest form of sharing in OS X is to make files available for other people who actually sit at your computer. Mac OS X has a few ways of doing this.

What Does It Share?

Mac OS X has two types of folders specifically designed to share files with other users of your computer. The first is a special folder called the Shared folder, located at /Users/Shared. The Shared folder is different from other user folders in two significant ways. First, it doesn’t correspond to any particular user; rather, it exists regardless of how many (or few) user accounts exist on your Mac. Second, all users can view the contents of the Shared directory, can move files to it, and can create files inside of it. In other words, as the name implies, it’s a folder that’s shared by all users.

The second way to share files with other local users is to use your personal Public folder, located at /Users/username/Public. Whereas most user-level folders prevent other users from even viewing their contents, the Public folder allows other users to view its contents and access files inside of it. You can make files available to other users by placing them in your own Public folder, and other users can share files with you by placing them in their own Public folder.

Tip

The Public folder also has a special folder inside of it called Drop Box. If you Get Info on this folder, you’ll see that, for everyone but the owner, its permissions are set to “Write only (Drop Box).” Think of this folder as your own personal mailbox—other users can drop files inside, but no one except you can get them out, or even verify that they exist. This folder is OS X’s way for users to exchange files securely.

I should mention two caveats when it comes to the Shared and Public directories. The first is that file permissions still apply. Documents created in these folders are set, by default, to allow other users Read Only access, and documents copied or moved to them retain their original permissions. In other words, if you want others to be able to edit a file that you place in one of these directories, you may need to manually change its permissions as discussed in Chapter 1. This includes the Drop Box—if you give someone a file you want them to be able to edit, be sure to give them Write access before putting it in their Drop Box. (Otherwise, they’ll have to make a copy of the file first—as explained in Chapter 1, the copy will be owned by them.)

The second caveat is that, by default, placing files in the Public or Shared folders provides the same level of access to all other users. If you have a sensitive document to which you want to limit access to a single individual, a better approach is to use their Drop Box. However, what if you want to provide access to a file to a group of users, but not all users? The answer is to use groups, as discussed in Chapter 1. You can create a group that includes only those users to which you want to give access to a file. Using the Finder’s Get Info command or a utility such as XRay or FileXaminer, you would give the members of that group Read Only or Read & Write access while restricting Others to No Access. You can then place the file in the Shared folder or your Public directory—even though the file will be in plain sight, only members of the group will be able to access it.

Finally, you may be wondering what the difference is between the Public and Shared folders. Besides the existence of the Drop Box in Public folders, there are two main differences. First, Public folders are set to allow Read & Write access to the owner, but Read Only access to other users, whereas the Shared folder allows Read & Write access for all users. Second, by default Public folders are accessible remotely via Personal File Sharing (which I’ll talk about in a bit) whereas the Shared folder isn’t.

Who Can Access Files?

Any user who has an account on your Mac has access to the main Shared folder and to every user’s Public folder.

How Do I Configure It?

Other than being careful with the permissions of files you place in the Public or Shared directories, no configuration is necessary.

How Do Others Access Files?

Other users can access files in these folders by simply navigating to them in the Finder.

Sharing Files Locally Using Multiple Volumes/Drives

Although I cover the topic of multiple volumes and drives in more detail in Appendix A, I want to mention it here as it relates to sharing files and file security. If you have multiple hard drives or volumes (including multiple partitions of a single hard disk), you should be aware that the default permissions for files created on any non-boot volume are Read & Write for the owner and Read Only for everyone else. Thus, saving a file to a non-boot volume is identical to saving it to a Public folder. This may be exactly what you want—many people use such a secondary volume as a place to share files. However, if it’s not, you can change permissions for individual folders or documents on the volume (or for the entire volume) using the Finder’s Get Info command. Another solution is to create files in a “private” area of your own user folder first and then copy them to the non-boot volume (since files copied to a shared area retain their original permissions).

At the other extreme, perhaps you have an extra hard drive that you’d like to use for shared projects—e.g., what if you want all users to be able to read and write to all files? Simply select the drive on the Desktop or in a Finder window and select File Ø Get Info. In the Ownership & Permissions panel, check the box next to “Ignore ownership on this volume.” Now OS X will ignore any and all permissions and restrictions on files on that volume. (Note that making this change requires admin access.)

Start Sidebar
Root and Admin Access and Sharing

For each type of sharing that I discuss in this chapter, I provide a summary of which files users can access. However, be aware that if you’ve enabled the root account, anyone logging in to your Mac (remotely or locally) as the root user will generally be able to access any file on your computer, regardless of the standard restrictions that are in place. (The lone exception to this would be Web Sharing; unless you’ve manually configured your Mac to provide access outside of the standard Web Sharing folders, user level doesn’t apply when connecting.) This is a good argument for not enabling the root account if you have any remote sharing services enabled.

What’s more, if you’ve enabled Remote Login (which I talk about in the next chapter), any admin user will be able to remotely enable the root account and then log in using that account. This is a good argument for not giving out admin-level accounts to other users (or for not enabling Remote Login, depending on how you look at it).

End Sidebar


Sharing Files Locally: Bluetooth

User Level | any
Affects | individual user
Terminal | no

In Chapter 9, I mentioned that OS X supports the Bluetooth wireless protocol and supports Blue- tooth as a way to exchange data between two computers within range of each other. You can use Bluetooth to your advantage as a way of quickly sharing small files between two Bluetooth-equipped computers.

Note

Because of its relatively slow speed, Bluetooth isn’t the best way to share large files; however, for anything less than a few hundred kilobytes, it should be fine.

What Does It Share?

Via “browsing” (explained below), you can share files in the Shared user folder—or any other single folder you designate—over a Bluetooth connection. In addition, you can send individual files directly to another Bluetooth-equipped Mac on a case-by-case basis.

Who Can Access Files?

Any Mac or Windows computer that has been paired with yours (as described in Chapter 9) can send files to and receive files from your Mac, or browse your Shared folder, provided that option is enabled. Because users of these other computers only need to provide a Bluetooth authentication password to pair their computer with yours, standard OS X user accounts are unnecessary. (This makes Bluetooth a convenient option for one-time file exchanges since you don’t need to set up a special account on your Mac. In fact, if all you’re doing is sending a file, you don’t even need to pair with the other computer first; Mac OS X temporarily pairs the two computers during the process of sending the file.)

How Do I Configure It?

There’s really very little configuration necessary for basic Bluetooth sharing; if you’ve paired with another Bluetooth-enabled computer, you’re already set up and can exchange individual files as described below.

In addition, under Mac OS X 10.2.4 and later you can take advantage of Bluetooth browsing—the ability for a paired computer to actually browse a directory of files and access those files much like using Personal File Sharing or FTP. To enable Bluetooth browsing, go to the File Exchange tab of Bluetooth preferences. Under the Bluetooth File Transfer section, check the box next to “Allow other devices to browse files on this computer.” By default, users of other computers can browse the Shared user folder; however, you can choose any other folder on your computer instead by clicking Choose Folder…

Warning

Because permissions don’t apply when using Bluetooth browsing, be sure to choose a folder that doesn’t contain sensitive data (or any sub-folders that may contain sensitive data). Unless the only computer that will pair with your Mac is another computer of your own, I recommend sticking with the Shared user folder.

How Do Others Access Files?

As I mentioned earlier, there are two ways to share files via Bluetooth: direct Bluetooth transfers and Bluetooth browsing.

Exchanging Files via Bluetooth File Exchange (Individual File Transfers)

You can send individual files to another computer using the Bluetooth File Exchange utility (located in /Applications/Utilities). To do so, drop a file onto the Bluetooth File Exchange utility icon in the Finder or the Dock or choose File Ø Send File… from within Bluetooth File Exchange and then navigate to the file. (If you launch the application by double-clicking it, it assumes that you want to send a file and immediately provides you with a file navigation dialog.) After dropping a file onto the utility, or choosing a file to send, a dialog will appear asking you to select the Bluetooth device to which you want to send the file. If you have multiple Bluetooth pairings, as I do, you can view just paired computers by choosing Computers from the Device Type pop-up menu (Figure 10.1). Click Send to initiate the file exchange. If the user of the selected computer has chosen to accept files automatically, the file will be transferred immediately; if not, the transfer will not commence until the user has manually accepted the file. (If you haven’t previously paired your Mac with the other computer, Mac OS X will initiate the pairing process before attempting to send the file.)

Tip

If you need to send multiple files or documents via Bluetooth File Exchange, it’s often easier to combine them into a single StuffIt or Zip archive so that you only have to send one file. (See “When to Compress/Encode Files for Sharing.”)

If another user wants to send a file to your Mac, the process works in reverse. They initiate a transfer, and if you’ve selected “Accept files without warning” in the File Exchange tab of Bluetooth preferences, the file will be saved to the directory you’ve chosen under “Folder for accepted items.” If you’ve instead selected “Prompt for each file,” a dialog will appear that tells you the name of the file and which paired device is sending it, and asks you if you want to accept the file.

Figure 10.1: Selecting a device to which to send a file via Bluetooth

Exchanging Files via Bluetooth File Transfer (Browsing)

If you prefer to allow other users to browse a folder on your hard drive and send files to, or retrieve files from, that folder, you need to enable the Bluetooth File Transfer option as described in “How Do I Configure It?” above. They will then be able to connect to, and browse, that particular folder at any time.

For Mac users, this is done by launching Bluetooth File Exchange and choosing File Ø Browse Device… In the resulting dialog (which looks almost identical to the Select Bluetooth Device dialog that appears when you send a file), they should select your Mac and then click Browse. A navigation dialog will appear (similar to an OS X Open/Save dialog) that includes Get… and Send… buttons (Get… and Put… under OS X 10.2). To download a file from your Mac, they should select it in the dialog and click Get…; conversely, to copy a file to your Mac, they should click Send… and then select the file from their own hard drive.

Note

At the time of this writing, if a folder contains one or more files or folders with an ampersand sign (&) in their name, the entire folder will appear empty via Bluetooth Browsing.

If you’ve enabled the Bluetooth status menu in Bluetooth preferences, you can access both the Send File and Browse Device commands from the menu bar at any time.

Note

Keep in mind that the settings for Bluetooth File Exchange (sending/receiving individual files) and Bluetooth File Transfer (browsing) are independent. (Yes, it’s confusing that Apple has named the former identically to the application you use to do both.) The ability to accept or reject each file sent to your Mac doesn’t apply via Bluetooth browsing, and the folders used by each are different, as reflected in the File Exchange tab of Bluetooth preferences.


Sharing Remotely: iDisk

User Level | any
Affects | individual user/.Mac account
Terminal | no

If you’re a subscriber to Apple’s .Mac Internet services, one of the benefits is your own personal iDisk. I’ve talked about iDisks a few times already in the book, but I want to discuss them here as a way to share files. Although an iDisk technically isn’t a standard part of OS X, I include it here for two reasons. First, many Mac users are .Mac subscribers. Second, and more important, since iDisks are hosted on Apple’s servers rather than on your own computer, placing files that you want to share on your iDisk means that you don’t have to enable any sharing services—which in turn means that you don’t have to worry as much about the potential for security issues that enabling such services brings. It also means that you don’t have to leave your Mac on in order to share files.

What Does It Share?

Your iDisk shares (with the “public”) any files that you place in its Public folder. (The Public folder on your iDisk is independent of your ~/Public directory; however, the two are similar in that they’re the only personal folders to which other users have access.)

Tip

Just like your user account on your Mac, if you give someone your .Mac username and password, they can view all files in all folders of your iDisk. If you want to securely share files with a group of people in different locations, buying a .Mac account and sharing the username and password is quite convenient. However, I’m going to focus on the Public folder here since it’s the most common way for users to share files via an iDisk.

Who Can Access Files?

Any user with an Internet connection, including both Mac and Windows users, can access your iDisk.

How Do I Configure It?

If you have only a single .Mac account, enter your .Mac username and password in the .Mac tab of the .Mac pane of System Preferences (the Internet pane under OS X 10.2). Then, from the Finder, choose Go Ø iDisk Ø My iDisk (or press shift+command+I, or click the iDisk toolbar item if you’ve added it to Finder window toolbars, or click the iDisk item in the sidebar if you’ve chosen to display it—whew!) to mount your iDisk in the Finder. Place any files you want to share in the Public folder at the root level of your iDisk.

If you have multiple .Mac accounts, an easier way to mount them is to use the iDisk Utility mentioned in Chapter 7, available from Apple’s .Mac website (http://www.mac.com/). In the Open iDisk pane, enter a member name and password and click the Open button. Alternatively, in OS X 10.3, you can choose Go Ø iDisk Ø Other User’s iDisk and then provide your username and password. (By other user it really means "not the member listed in the .Mac tab of .Mac preferences.")

Tip

If you have multiple .Mac accounts, or if you frequently access multiple iDisks, a much more convenient way to access them is using Internet Location files. I discuss these Location files in the next chapter when I talk about how to connect to shares.

Finally, you can control access to your iDisk’s Public folder using either the iDisk tab of .Mac preferences or the Public Folder Access pane of iDisk Utility (Figure 10.2). You can decide whether other users have Read Only access (which prevents them from placing or editing files on your iDisk) or Read Write access (which lets them both access/edit files on and copy files to your iDisk). You can also decide whether users will have to provide a password to access your iDisk’s Public folder.

Figure 10.2: Using iDisk Utility to control access to your Public folder

How Do Others Access Files?

Users of Mac OS X can access your iDisk in three ways. The first method is by using the Open Public Folder pane of iDisk Utility—they simply enter your member name and click the Open button. The second method, available in OS X 10.3 or later, is to choose Go Ø iDisk Ø Other User’s Public Folder… Finally, OS X users can also access your iDisk by choosing Go Ø Connect to Server… (or pressing command+K) in the Finder and then entering http://idisk.mac.com/membername/Public in the Address field.

For all three methods, if your iDisk is password-protected, a dialog will appear; the user should enter public as the username (if requested) and your iDisk’s Public folder password in the password field.

Users of other operating systems can access your iDisk’s Public folder using the following techniques:

Mac OS 9 Until early 2004, Apple’s iDisk servers supported Apple Filing Protocol (AFP), so OS 9 users could access iDisks via the Chooser. However, in January 2004, Apple discontinued AFP access, supporting only the World Wide Web Distributed Authoring and Versioning (Web-DAV) protocol (see http://www.webdav.org/ for more information about WebDAV). This means that OS 9 users need to use third-party software to access iDisks. Fortunately, the utility Goliath (http://www.webdav.org/goliath/) provides a simple solution. Launch Goliath under OS 9 and then choose File Ø New Connection… Enter http://idisk.mac.com/membername-Public in the URL field, public in the User Name field, and, if applicable, the Public folder password in the Password field. (If the Public folder isn’t password-protected, leave the Password field blank.) Click OK and a window that looks like an OS 9 Finder window will appear listing the contents of the Public folder of the iDisk. (Goliath also has a command called Open iDisk Connection from its File menu; however, you can’t use this command to connect to a Public folder.)

Windows XP Open My Computer and then choose Tools Ø Map Network Drive. Enter http://idisk.mac.com/membername-Public (where membername is your .Mac member name). For authentication, use your .Mac member name and, if necessary, your Public folder password. (Alternatively, you can download the iDisk Utility for Windows XP from Apple’s website, which works just like the OS X version.)

Windows 2000 Open My Computer and then choose Tools Ø Map Network Drive. Click “Web folder or FTP site,” and then enter the address provided above for Windows XP.

Windows 98 Open My Computer, open the Web Folders icon, and then double-click Add Web Folder. Enter the address provided above for Windows XP.

Sharing iDisk Files Using a Web Page

In addition to providing direct access to your Public folder, you can also set up a Web page that allows other users to view or download files located in that folder. Go to the main .Mac Web page (http://www.mac.com/) and click the Home Page graphic. Log in to your .Mac account, and on the main Home Page page, click the File Sharing tab. Click a color for your File Sharing Web page, and you’ll be presented with the configuration screen. You can edit the text on the page by clicking the Edit button and update the Web page (if you’ve recently added files) by clicking the Update button. Once your File Sharing page is ready, click the Publish button to make your Public folder files available via the Web. (Once you do this, you’ll be presented with the URL of your File Sharing page— make sure you keep a record of it.)

Warning

If you’ve given your iDisk’s Public folder a password, be aware that iDisk’s File Sharing Web page does not honor that password. Thus, if you make files available using .Mac’s Home Page feature, any user who knows your .Mac member name will have access to the files in your iDisk’s Public folder. To prevent this, Home Page provides a way to protect your site with its own password—just click the “Protect this site” button on the main Home Page Web page. Also, if you take advantage of the Home Page password-protection option, be aware that both your username and password are case sensitive, so when you provide another user with the URL to your website, be sure the username portion of it is capitalized correctly.


Sharing Remotely: Personal File Sharing

User Level | admin to enable and configure; any user can share files
Affects | computer
Terminal | no

If you’d rather not have to upload files to an iDisk to share them, and your computer is generally on and accessible by other computers—over a local network or the Internet—you can use one of OS X’s built-in file sharing services. These services allow others to access files that actually reside on your computer. Like Mac OS 9 before it, Mac OS X provides Apple’s own File Sharing protocol (also called Apple Filing Protocol, or AFP), which is the best way to share files with other Macs over a local network. However, unlike OS 9’s File Sharing, OS X’s Personal File Sharing is also a fast and reliable way to share files over the Internet.

What Does It Share?

By default, Personal File Sharing provides non-admin users with remote access to the files in their own user folder and to files in other users’ Public folders. This means that if you want other users to be able to access files using Personal File Sharing, be sure to put those files in your Public Folder. However, it’s possible to further restrict access or to provide access to additional directories; I’ll talk about how to do both under “How Do I Configure It?”

Start Sidebar
When to Compress/Encode Files for Sharing: File Sizes and Resource Forks

When sharing files, especially over a network or Internet connection, there are a couple of things to keep in mind. The first is that even though most Internet connections today are much faster than those of a few years ago, many people are still using dial-up connections, and even broadband connections have their limits. If you’re sharing files over the Internet, or over a slower local connection such as Bluetooth, I highly recommend using a file compression utility to make your shared files as small as possible. This will shorten the time it takes others to download or access files, and it will save bandwidth for you.

Luckily, OS X ships with a good compression utility. Aladdin’s DropStuff (inside the StuffIt Lite folder in /Applications/Utilities) is a shareware version of the commercial StuffIt package. If you drop individual files or entire folders of files onto its icon, they’ll be compressed using the StuffIt compression format; the end result is a single file that’s significantly smaller than the original(s). If you’ll be sharing your files with Windows users, a better choice would be the .zip format, more common on the Windows side of things. You can compress files in this format using Aladdin’s DropZip utility (located in the same folder as DropStuff), or you can use the Finder’s Create Archive command, which I discussed in Chapter 5 (available via the Finder’s File menu, Action menu, or contextual menus). Another option, if you’re sharing files with only Mac users, is to create compressed disk images; I discussed how to do this in Chapter 7.

Compression won’t be convenient for files that will be used often, such as documents that are in progress or project files that multiple users will be accessing frequently, but for files that you’re simply making available for a single download (or for download by a number of people), compression is a very good idea.

The second thing to be aware of when sharing files is that the file structures of some files on the Mac platform can present problems for Internet transfers. As discussed in Chapter 5, many Mac files—especially those from Mac OS 9 and earlier, but also many created in Mac OS X—are composed of two parts: a data fork and a resource fork. Simply put, the data fork contains the file’s data, and the resource fork contains information about the file. Unfortunately, although Apple’s Personal File Sharing protocol keeps both forks intact, some other Internet protocols, such as FTP, SFTP, and SMB/CIFS (all discussed in this chapter), can strip the resource forks in transit. In addition, copying a file to a Windows or Unix computer and then back to the Mac may also strip the resource fork. (This generally isn’t a problem for common document formats such as HTML, text, Word, and Excel files; it becomes an issue with more complex files such as applications.)

For this reason, even if file size isn’t an issue, I also recommend using the Finder’s Create Archive command or a program such as DropZip to compress files when you’re sharing them over FTP or with Windows or Unix computers—such compression will preserve the resource fork.

End Sidebar

What admin users see when connecting via Personal File Sharing is a bit trickier. In general, when admin- level users connect, they have the same access to files as they would if they were sitting at the computer. In other words, they can access any file except for those inside other users’ private directories. Because of this, the specific options they see when they connect differ from normal users. In OS X 10.2, when admin-level users connect, they see only volumes—they don’t see their own home directory or other shares that have been configured (although they can still access both via the volumes containing those items). In OS X 10.3, on the other hand, admin users see share points and volumes. (For more information on how to set this preference for admin users, see http://docs.info.apple.com/article.html?artnum=107823; although the article claims to be for Mac OS X Server, it also applies to Mac OS X.)

Note

If you have FileVault enabled for your account (see Chapter 13), you must be logged in locally in order for other remote users to be able to access any files inside your home directory; otherwise, they will simply see your FileVault disk image when viewing your home directory. (As the owner of that directory, if you connect remotely via Personal File Sharing, you can double-click the image file and provide your account password in order to mount the FileVault disk image on the machine from which you are connecting.)

Who Can Access Files?

By default, individuals with a user account on your computer can access their own user folder, and other users’ Public folders, via Personal File Sharing. In addition, users without an account can connect as Guest (more on that in a bit), but their access is restricted to just Public folders. The only caveat is that to connect, remote users must have a Mac that supports Apple Filing Protocol over TCP/IP (which is basically Mac OS 9 or OS X).

Warning

By default, an admin-level user can also remotely connect as any other user via Personal File Sharing by using the other user’s username and their own admin-level password (more on connecting below). This is an administration feature, as it allows the administrator to test normal user accounts and their Personal File Sharing access. However, because it can be misused in the wrong hands, this feature is yet another reason not to provide admin access to anyone who doesn’t absolutely need it.

Note

A maximum of 10 users can be connected to a single Mac via Personal File Sharing simultaneously.

How Do You Configure It?

Once you’ve got a network or Internet connection, Personal File Sharing requires little configuration for basic operation. First, you give your computer a Computer Name and a Rendezvous Name in the Sharing pane of System Preferences. The Computer Name field is your computer’s “official” name—this shows up in Finder windows and in Terminal—whereas the Rendezvous Name is your computer’s name as it appears to Rendezvous-enabled devices. (To change your Rendezvous Name under OS X 10.3 or later, click the Edit… button at the top of the Sharing preferences window, type your preferred Rendezvous name in the Local Hostname field, and then click OK.) Then you simply check the box next to Personal File Sharing in the Services tab (Figure 10.3), or select Personal File Sharing and click the Start button to the right. (To stop sharing files this way, either uncheck the box or select Personal File Sharing and click the Stop button.) Once you’ve enabled Personal File Sharing, you’ll see a helpful message at the bottom of the window: “Other Macintosh users can access your computer at afp://yourIPaddress/ or browse for ‘name’ by choosing Network from the Go menu in the Finder."

Figure 10.3: Enabling Personal File Sharing in Sharing preferences
Note

If you’re behind an Internet router, the IP address provided by the Sharing preference pane will be valid only for other users on your local network; in addition, if you have a dynamic IP address, it will only be valid until your ISP or Internet router provides you with a different one. See the sidebar “Your IP Address: Internet Routers, Port Caveats, and Dynamic IPs” for information on working around these limitations.

Although enabling Personal File Sharing for basic operation is quite simple, a number of options are available to you via third-party utilities. You can disable Guest Access, create sharing-only user accounts, disable the sharing of some or all Public folders, enable the sharing of additional directories, and much more. Here are some of the most convenient and useful options and how to enable them.

Disabling Guest Access to Personal File Sharing

By default, OS X’s Personal File Sharing allows Guest users—users who don’t have their own account on your computer—to connect and access a limited group of files (those in Public folders). This feature is quite useful for providing access to certain files for remote users without having to create local accounts for them, but it also means that anyone who knows your IP address can potentially connect as a Guest user and access Public files. Although this shouldn’t be a major security issue—the only “damage” a Guest user can do is to download copies of files in Public folders, which which shouldn’t be confidential in the first place if you’re careful what you place there—you may not want to completely open up your Public files to the, um, public.

If Guest Access concerns you, you can disable it (and re-enable it at any time) using the donationware SharePoints (http://www.hornware.com/sharepoints/). A few other, simpler, utilities out there allow you to toggle Guest Access, but SharePoints does so much more, and I’ll use it for so many of the examples in this chapter, that I consider it to be the Swiss Army knife of Personal File Sharing utilities. (It also has other capabilities; you may have used it in Chapter 1 to set up a new group.) It’s available as both a preference pane and an application. I personally prefer the preference pane version (it seems more intuitive to me to work with Personal File Sharing settings in System Preferences), but I’m going to use the application version for this discussion because the screenshots are clearer. Both versions function identically. To disable Guest Access, launch SharePoints and then follow these steps:

  1. Click the AFS Properties tab (AppleFileServer Properties in older versions of SharePoints).

  2. In the Miscellaneous Properties section, uncheck the box next to Allow Guess Access.

  3. Click the Update AppleFileServer Properties button. You’ll be asked for your admin-level username and password. This updates the Personal File Sharing preferences and, if applicable, restarts Personal File Sharing.

Other users will no longer be able to log in as Guest and access user Public folders. (See “How Do Others Access Files?”) To re-enable Guest Access (or if for some reason your Mac never had it enabled), use the same procedure but check the box next to Allow Guest Access instead.

Tip

Most of the Personal File Sharing custom settings I discuss in this chapter are accessible via Terminal, NetInfo Manager, or the /System/Library/Preferences/AppleFileServer.plist file. However, using a utility such as SharePoints is so much easier and—because there’s no chance for mistyping—safer that there’s really no reason not to use it.

Creating File Sharing Only Users

If you’ve disabled Guest Access, you may be wondering how you allow remote access to Personal File Sharing to individuals who don’t have a local account. You could create a single, extra user account and then provide that username and password to everyone you want to be able to access files over Personal File Sharing. However, that would be a rather inconvenient and messy solution. A better solution is to create “File Sharing Only” users. Again, SharePoints is the easiest way to do this.

File Sharing Only users can connect to Personal File Sharing but can’t log in locally, don’t have their own user directory, and can’t log in using the Remote Login feature (discussed later in this chapter when I cover SFTP sharing, and in the next chapter when I talk about Remote Access). These types of user accounts are ideal for users with whom you want to share files but who will never actually sit down at your computer and log in. To create a File Sharing Only account using SharePoints:

  1. Click the Users & “Public” Shares tab.

  2. Under Individual Users, fill in the user’s full and short name (just as if you were setting up a new account in Accounts preferences).

  3. In the Group pop-up menu, choose staff. (If you’ve set up any groups of your own, and you want the new user to be a member of one of those groups, you would select that group name instead.)

  4. Click the Get Next UID button; SharePoints will automatically assign the new user the next available user ID (Figure 10.4).

    Click To expand
    Figure 10.4: Setting up a File Sharing Only user in SharePoints

    Tip

    If you don’t want the File Sharing Only user to be included in the list of users at the login screen, instead of using SharePoints’ Get Next UID button, manually type in a user ID between 475 and 499. (User IDs less than 500 aren’t displayed at the login screen.) Just be sure not to use the same user ID as an existing user. (SharePoints lets you view each existing account’s user ID, and using a number above 475 is generally safe.)

  5. Ignore the “Public Directory Shared?” pop-up menu; users created within SharePoints don’t have Public folders. (This option exists to allow you to edit existing user accounts, as described in the next section.)

  6. Click Add New User (provide your admin username and password if prompted). You’ll be asked if you really want to add a File Sharing Only user; if you answer Yes, you’ll then be asked to provide a password for the account.

The new user you just created will be able to log in via Personal File Sharing and view Public fold- ers, but will have no other system privileges.

Warning

A File Sharing Only user account will still appear in Accounts preferences (as a Standard user). However, although you can change the user’s password from Accounts preferences, you shouldn’t edit any other settings for the account.

Disabling/Enabling Sharing of Public Directories

What if you don’t want remote users to be able to access certain, or all, user Public folders? You can also use SharePoints to disable the sharing of individual Public folders, or you can choose to disable all Public folder sharing and then manually enable the sharing of other folders (using the next tip). For example, you could choose to disable all Public folder sharing and then provide access to the Shared folder instead. To edit the sharing of Public folders:

  1. Click the Users & “Public” Shares tab.

  2. In the User column on the left, select the user whose Public folder you want to prevent from being shared.

  3. In the “Public” Directory Shares section, click Disable Selected. (Or click Enable Selected if you had previously disabled sharing for that user and want to re-enable it.) If asked, enter your admin-level username and password.

  4. Repeat Steps 1–3 to disable/enable sharing for additional users’ Public directories.

Tip

You can quickly disable or enable the sharing of all Public directories using the Disable All and Enable All buttons.

Sharing Additional Directories via Personal File Sharing

If you want to share files in directories other than, or in addition to, Public folders, you can do this by creating what are called share points. (This is actually where SharePoints got its name—it was originally just a utility to help you create new share points.)

  1. Click the “Normal” Shares tab.

  2. In the Share Name field, enter the name of the share. This can be the name of the folder you plan to share, or anything else. However, since this name will be included in the list of shares users see when they connect to Personal File Sharing, it should be something unique and descriptive.

  3. Click the Browse… button next to the Directory field. Navigate to the folder you want to share, select it, and then click the Open button. The path to your chosen folder will appear in the Directory field.

  4. From the AppleFileServer (AFS) Sharing pop-up menu, choose “Shared (+).”

  5. Click Create New Share to create the share; if prompted, enter your username and password.

You can delete a share by selecting it from the list of shares and then clicking Delete Selected Share. You can also use SharePoints to quickly change the permissions of the shared directory by selecting a share and then clicking the Show File System Properties button. A drawer will slide out that shows the current owner, group, and permissions for the selected share. You can change them via the pop-up menus; to apply the changes, click the Update Share button afterward. However, note that SharePoints can only change the permissions for the top level of the shared directory you’re editing. To provide more or less access to the files within that directory, you should use the Finder’s Get Info command or a third-party file utility.

Tip

To disable Personal File Sharing access for a custom share without deleting it, select the share in the list of Normal shares, choose “Disabled (-)” from the AppleFileServer (AFS) Sharing pop-up menu and then click Update Share.

Enabling Personal File Sharing over AppleTalk

Although Mac OS X shies away from AppleTalk (OS X will only use it for local networking if you specifically enable it), AppleTalk is still the predominant networking protocol for many older Macs. In fact, some older versions of the Mac OS—still in use on older Macs and in many schools—don’t even support Apple’s IP-based file sharing protocol. This can present a problem if you’re trying to share files with these computers. However, although Apple doesn’t advertise it, Mac OS X does support File Sharing via AppleTalk. To enable it, launch SharePoints, and in the AFS Properties tab, check the box next to Use AppleTalk in the Miscellaneous Properties area. You’ll need to click the Update AppleFileServer Properties button to restart Personal File Sharing; once it starts up again, your Mac will be visible on an AppleTalk network.

Activating the Personal File Sharing Log

Users of Mac OS 9 may remember the File Sharing Monitor, which provided you with a list of connected File Sharing users. Mac OS X doesn’t include such a feature (it’s reserved for OS X Server); however, it does include the ability to keep a detailed log of all Personal File Sharing activity, and you can then use some third-party software to monitor that log. To enable the log itself, fire up Share- Points again, and in the AFS Properties tab, look at the Logging Properties section. If you check the Enable Logging box, OS X will begin to log any or all of the types of activities checked in the boxes to the right (Logins, Logouts, etc.). (By default, the log is located at /Library/Logs/AppleFileService/AppleFileServiceAccess.log). After you’ve enabled the desired options, click the Update AppleFileServer Properties button.

You can view the log in a text editor such as TextEdit at any time; however, if you’d like to monitor the log—and, thus, Personal File Sharing activity—in real time, the developer of SharePoints has written another useful utility called AFS Monitor (http://www.hornware.com/afsmonitor/). Once you launch AFS Monitor, it shows you a list of connected users along with a brief summary of each user’s connection activity; its Dock icon also shows the number of users currently connected. Another alternative is the menu utility xAFP (http://www.xeir.com/home.php), which shows the same information provided by AFS Monitor in a useful menu bar menu.

If you’re the retro type, in OS X 10.3 and later you can instead open the Console utility and choose File Ø Open Quickly Ø /Library/Logs Ø AppleFileService Ø AppleFileServiceAccessLog, which will show you the log in all its textual glory. Or, even more “hardcore geek,” in any version of Mac OS X you can open a new Terminal window and type tail -f /Library/Logs/AppleFileService/ AppleFileServiceAccess.log <RETURN>. This will show the last few lines of the log in the Terminal window. In either case, the display will be updated in real time.

Other Options in SharePoints

In addition to the options I’ve discussed here, SharePoints also provides a number of other features you’ll have to explore for yourself. I mentioned the ability to create groups in Chapter 1, but you can also create a welcome message that other users will see when they connect, change the ports used by Personal File Sharing, and even set up idle timers so that users are automatically disconnected if they’re idle for too long. You can also configure and customize OS X’s Windows File Sharing (which I’ll talk about later in the chapter).

How Do Others Access Files?

How other users access Personal File Sharing on your Mac depends on whether they’re connecting over a local network or over the Internet and whether they’re connecting from Mac OS X or Mac OS 9 and earlier. To make things easier, I’ll talk about each separately. Once connected, regardless of the method, the user will get a dialog to enter their username or password (unless they’re using Guest Access, in which case they’ll skip that step). They’ll then get a dialog where they can choose which share points (guest, normal, and File Sharing Only users) or which volumes (admin users) they want to mount on their own computer. From there they can access files just as they would on any other mounted volume.

Local network: Mac OS X From another Mac running OS X on a local network, the user has two choices. The first is to click the Network icon in any Finder window sidebar or toolbar (if visible) or choose Go Ø Network (or press shift+command+K). Due to the magic of Rendezvous, your Mac will show up in the Network window in the Finder by its Rendezvous name; they should select it and click Connect… Alternatively, they can choose Go Ø Connect to Server… (or press command+K) in the Finder, enter afp://rendezvousname.local or afp://yourIPaddress/ in the Server Address field (where rendezvousname is your computer’s Rendezvous name or IPaddress is your Mac’s local IP address), and then click Connect. (Clicking the Browse button in the Connect to Server dialog is the same as accessing the Network view in the Finder; the Connect To Server dialog will disappear and a new Finder window will open in Network view.)

Local network: Mac OS 9 Users of Mac OS 9 should choose Apple Menu Ø Chooser. On the left side of the Chooser window, select the AppleShare icon. Then on the right, click the Server IP Address… button. In the resulting dialog, they should enter your local IP address (if both computers are behind an Internet router, or have been given their own static IP addresses, this will be the IP address provided in Sharing preferences) and then click Connect. (If you enabled Apple-Talk for Personal File Sharing, when they click the AppleShare icon, your Mac should show up on the right side of the Chooser; they should simply select it and click Connect.)

Local network: Mac OS 8.x and earlier If you’ve enabled AppleTalk File Sharing, users of pre–OS 9 systems should choose Apple Menu Ø Chooser and then click the AppleShare icon on the left side of the Chooser. They should then select the icon for your Mac on the right side (it should show up automatically) and then click Connect.

Via the Internet: Mac OS X Mac OS X users accessing your Mac over the Internet should choose Go Ø Connect to Server… (or press command+K) in the Finder to bring up the Connect to Server dialog. In the Address field, they should enter afp://yourIPaddress/ (or replace yourIPaddress with your domain name, if you have one assigned to your Mac) and then click Connect.

Via the Internet: Mac OS 9 Mac OS 9 users accessing your computer over the Internet should follow the same procedure they do when accessing over a local network; the only difference is that they should enter your Internet IP address (or your domain name, if applicable) rather than your local one. If you have a static IP address and aren’t behind an Internet router, the two will probably be the same.

If you don’t have a static IP address, or you’re behind an Internet router, this adds a few wrinkles when other users try to access your Mac over the Internet. See “Your IP Address: Internet Routers, Port Caveats, and Dynamic IPs.”


Sharing Remotely: FTP

User Level | Admin
Affects | Computer
Terminal | no

Personal File Sharing is probably the most feature-rich and flexible OS X method of sharing files over the Internet or a network. However, it has the distinct disadvantage of only allowing sharing between Macs (unless you install special software on a Windows computer, but that’s beyond the scope of this book). Because of this, Mac OS X also provides a number of ways to share files between Macs and non-Macs. FTP, which stands for File Transfer Protocol, is one of these—OS X has an FTP server built-in. FTP has been a staple of Unix servers since well before the Mac OS and Windows even existed and is largely platform agnostic (it allows connections between Macs, Windows, Unix, Linux, and many other operating systems).

Warning

FTP has a major drawback: It’s one of the least secure methods of communicating between two computers. All usernames, passwords, commands, and file data are sent in plain text, meaning that anyone who might be able to intercept that data would be able to easily figure out the username and password of anyone who connects (and may be able to then use that information to log into other services). It’s also the most difficult to configure for the average user. For these reasons, I recommend not enabling FTP Access. I’m going to talk about it briefly, but if you need FTP-like sharing capability, you’re far better off using Secure FTP (SFTP), which I talk about later in this chapter. In addition, consider more secure and configurable sharing methods such as Personal File Sharing and Windows File Sharing.

Start Sidebar
Your IP Address: Internet Routers, Port Caveats, and Dynamic IPs

In many of the methods for file sharing that I discuss in this chapter—specifically, Personal File Sharing, Windows File Sharing, Personal Web Sharing, FTP, and SFTP—users trying to access your files will need to provide your computer’s IP address. If the other users are on your local network, they can simply use the IP address listed in the Services tab of Sharing preferences (the one that appears when you enable a Sharing service). On the other hand, users accessing your Mac over the Internet may need to use a different IP address.

If your ISP or network administrator provides your computer with a static IP address, and your computer is not behind some sort of Internet router, you don’t need to worry; the address listed in Sharing preferences is the same for locally networked and Internet users. However, if your computer is behind an Internet router, you’ll need to do some work of your own to allow others to connect. (I discussed Internet routers in the previous chapter; they’re basically devices that allow multiple computers to share a single Internet connection. Many are hardware devices, but if you’re connected to another Mac that’s sharing its Internet connection with you—using OS X’s Internet Sharing—that Mac is acting as an Internet router.) In addition, if your ISP or network administrator doesn’t provide you with a static IP address—one that remains the same at all times— you’ll need to do some additional legwork to make it easy for others to connect.

Internet Routers and IP Addresses

If you connect to the Internet through an Internet router, your ISP-assigned IP address identifies the router, not any individual computer connected to the router. This presents a problem when sharing files over the Internet, as a user who connects to your IP address actually connects to the router instead of your computer. The end result is that the user will receive an error.

Luckily, there’s a solution to this problem. As I’ll discuss in more detail in Chapter 11, every computer connects to the Internet over a multitude of ports, each dedicated to certain types of data. These ports are different from OS X’s network ports; in terms of Internet service and protocols, a port is a specific service on a computer or server that deals with a certain type of data. For example, Apple’s File Sharing Protocol uses port 548 by default—when your computer receives data intended for port 548, it directs that data to the Personal File Sharing service. Ports function much like telephone extensions at a place of business; a person (another computer) dials the main number (the IP address) to reach the business, but they need to tell the receptionist the extension (the port) of the person (the service) they’re trying to reach. Using specific ports in this manner allows data to be transferred more efficiently and effectively.

By taking advantage of these service-specific ports, you can enable what’s called port mapping or port forwarding on your Internet router. Basically, port mapping is a way to tell your Internet router that data intended for a certain port should always be directed to a specific computer behind the router. For example, you can elect to have all attempts to connect to Personal File Sharing (which uses port 548) on a specific computer forwarded—or mapped, in tech-speak—to that computer.

To set up port forwarding, you should consult your Internet router’s manual or help files. On most models, it’s as easy as entering the port number you want to forward, followed by the name or internal IP address of the computer to which you want data for that port to be forwarded. To help you out, here are the port numbers for most of OS X’s sharing services:

Personal File Sharing (AFP) 427, 548

Windows File Sharing (SMB) 139

Personal Web Sharing (HTTP) 80, 427

Remote Login and SFTP (SSH) 22

FTP Access (FTP) 20, 21

(You can see a complete list of ports used by Mac OS services at http://docs.info.apple.com/article.html?artnum=106439.)

One downside to port mapping when it comes to sharing files over the Internet is that only a single computer behind your router can provide each type of sharing service to computers over the Internet. For example, if your computer is mapped for Personal File Sharing, all requests on port 548 will be directed to your computer, even if another Mac behind your router also has Personal File Sharing enabled.

Port Caveats

While I’m on the topic of ports, I should mention another potential drawback of the port system: the ability of ISPs to prevent certain ports from transferring data. Some ISPs prohibit their users from setting up “servers”—their term for any service used to distribute files over the Internet. To prevent such services while still allowing standard Internet access, they generally block only known “server ports”—ports used by well-known file sharing services. Some of the most commonly blocked ports are those used by HTTP (Web) servers and FTP servers. In addition, ports used by file sharing systems such as Kazaa and Napster may also be blocked. If you’re having trouble sharing files with others, or accessing files on your own computer over the Internet from another computer, you may be the victim of port blocking. (Although I under- stand the motivation behind port blocking, I personally think that there’s a difference between sharing pirated music and software and sharing personal files. In my opinion, ISPs should concentrate on monitoring excessive data transfers, rather than preventing all file sharing, legitimate or not.)

Fortunately, because Mac users usually constitute a minority of an ISP’s customers, many ISPs aren’t familiar with all of the sharing services available in OS X. As a result, the ports used by many Mac-only services (e.g., Personal File Sharing) are rarely blocked. So if one sharing method doesn’t work for you, consider using a different method.

If you’re set on using a particular service but your ISP blocks the port used by that service, it’s technically possible to change the service’s port. However, this is considered to be a Bad Thing™ and, as such, I’m not going to cover such procedures here.

Dynamic IP Addresses and Sharing

If your connection to the Internet is via PPP or PPPoE, or if your Internet router or office network provides you with an IP address via DHCP, your IP address may change periodically—this is called a dynamic address. Unfortunately, dynamic IP addresses are a major pain if you’re trying to share files over the Inter- net; if you give someone your IP address, they have to connect to your computer before your IP address changes, and even if that’s successful, there’s no guarantee that your IP address will be the same the next time they attempt to connect.

There are really only two ways to deal with dynamic IP addresses and sharing files. The first is to simply provide your current IP address to others each time they want to access your computer. The freeware DockIP (http://www.kainjow.com/software/dockip.html), IPMenu (http://www.loopware.com/software/), and IP (http://perso.wanadoo.fr/vigan/aksoft/index.html) are great little apps that provide your current IP address—if you’re behind an Internet router, they even provide your external IP address in addition to your local (router-assigned) IP. DockIP, as its name implies, provides this info via a Dock menu whereas IPMenu and IP provide it via a menu bar menu.

If you’d rather not have to give others your IP-address-of-the-moment each time you want to share files, you’ll have to use one of the dynamic DNS services out there. These services provide you with either your own domain name or a sub-domain of their main domain (e.g., yourname.theirdomain.com). Using a small client application that you run on your own computer, these services keep track of your IP address each time you connect to the Internet and then forward any requests intended for your domain to your actual current IP address. Thus instead of giving other people your IP address, you simply give them your domain name.

Although I’ve never used any of these services, the most popular seem to be http://www.DynDNS.org, http://EasyDNS.com, and http://ZoneEdit.com. At the time of this writing, the dynamic DNS client of choice for OS X—a DNS client provides your current IP address to the dynamic DNS hosting service— seems to be DNSUpdate (http://www.dnsupdate.org/).

End Sidebar

What Does It Share?

With FTP Access enabled, users will have the same level of access to files that they would have if they were sitting at the computer. In other words, normal users will have full Read & Write access to their home directory, Read Only access to other users’ Public folders and the Shared user folder, and Read Only access to most other files on your computer. (An admin user will have much more leeway.)

Although this type of access should be fine if you know and trust your users, it does pose some additional security risk, especially if you’re providing access to unknown or untrustworthy people. With FTP, Read & Write access means the ability to download, upload, rename, and delete files, and Read Only access means the ability to download files. Thus, any admin-level user who connects via FTP will be able to perform some pretty serious file operations, and even non-admin users will be able to download (and thus view the contents of) many non-private files (i.e., files not located inside private user directories). For example, in the stock configuration of OS X’s FTP Access, a normal user could connect and then download all of the files in /Library/Preferences—some of which may contain software licenses or, in the case of a file such as /Library/Preferences/SystemConfiguration/preferences.plist, all of your network settings.

Who Can Access Files?

If FTP Access is enabled, anyone with a user account on your computer can connect to it via an FTP client (from any platform: Windows, Mac, or Unix). However, it’s possible to restrict the list of users who can connect over FTP; I’ve explained how to do this under “How Do I Configure It?”

Warning

Most FTP servers have a way to provide anonymous access—users can log in with the username anonymous and no required password. The way many Unix FTP servers, including the one in OS X, enable this feature is to check for a user account called ftp. If that account exists on the computer, anonymous access is turned on automatically. So unless you want to enable anonymous access to your Mac, don’t create a user account called ftp.

How Do I Configure It?

To enable FTP Access, check the box next to FTP Access in the Services tab of Sharing preferences. If you want to configure some of the more advanced options that the FTP server offers, you need to manually edit configuration files or use a third-party utility as described below.

Restricting FTP Access to Certain Users

If you’re going to enable FTP Access, I recommend disallowing access to everyone but the specific users you want to use it. To do this, you need to edit the file /private/etc/ftpusers (you’ll need to launch a text editor as root to edit the file). At the bottom of the list of usernames, type the short user- name of any user to whom you don’t want to provide FTP access. Save the file, disable FTP Access, and then enable it again.

Further FTP Configuration

It’s actually possible to configure Mac OS X’s FTP server to restrict access to certain directories, as well as to customize many other settings; unfortunately, space constraints prevent me from covering these topics (especially since I don’t recommend FTP in general). If you’re interested in how you’d do this, check out the Unix configuration utility The Moose’s Apprentice (http://www.wundermoosen.com/wmTMA.htm), which is not only an excellent utility for configuring FTP options but also provides a great deal of information about many Unix configuration files in its documentation (which is available online at http://www.wundermoosen.com/TMAHelp/TMA_Help.htm). Alternatively, you can install a third-party FTP server such as the popular Pure-FTPd. The third-party software package ftp-config (http://www.gritsch-soft.com/index.html) installs Pure-FTPd and provides a nice graphical user interface for configuring it. If you’re serious about FTP, this is a great alternative to OS X’s built-in FTP server. (Another good option is CrushFTP, available from http://www.crushftp.com/.)

Compressing/Encoding Files

Another drawback of FTP is that sometimes Mac files transferred over FTP lose their resource forks (those that have resource forks, that is). For this reason it’s often a good idea to use a utility such as DropStuff to not only “stuff” files that will be transferred via FTP but to also encode them in BinHex format (available from the DropStuff preferences dialog). See “When to Compress Files for Sharing” for more info.

How Do Others Access Files?

Users will be able to access files via FTP from any platform using any standard FTP client. In their FTP client, they should enter your IP address (or your domain name, if applicable) as the server address, and they should use their username and password on your computer as their login name and password. (Again, keep in mind the caveats about IP addresses I’ve mentioned throughout this chapter.)

Alternatively, many Web browsers also understand FTP; users can generally enter ftp:// yourIPaddress/ as the URL, and their browser will then ask them for their username and password.

Finally, since FTP is technically a command-line application (it’s been in use since long before graphical computing interfaces made their debut—graphical FTP clients are simply providing you with a pretty face to hide the command line), anyone with a terminal or console application and Internet access can connect using the command ftp yourIPaddress <RETURN>. They’ll be prompted for their username and password; once they’re logged in, they can use standard ftp commands to access files.

Note

Mac OS X keeps a log of all FTP activity when FTP Access is enabled; it’s located at /private/var/log/ftp.log. You can view this log in any text editor or by using one of the log file utilities I mention in Chapter 14. In fact, if you have a broadband connection, you’ll probably see lots of attempts to log in—your friendly neighborhood (or other-side-of-the-world) hacker is testing to see if you’ve enabled anonymous FTP access. Note that if you allow OS X’s weekly maintenance scripts to run (as described in Chapter 14), your FTP log will include only FTP events from the past week, beginning Saturday.


Sharing Remotely: Secure FTP (SFTP)

User Level | admin
Affects | computer
Terminal | no

As I mentioned in the previous section, FTP is convenient but extremely unsecure. I just don’t recommend it unless you have no other choice for sharing files, and even then I recommend creating a single, non-admin user account for sharing files via FTP. If you’d like to gain the cross-platform advantages of FTP without the security issues, you should instead consider Secure FTP (SFTP).

Like FTP, SFTP is actually a command-line method for connecting to servers and working with files. However, whereas FTP uses a clear-text connection, SFTP uses the secure shell (SSH) protocol to connect, meaning all communication between the client and server, including passwords and data, are encrypted to prevent anyone who might intercept the data from being able to use it.

The downside to using SFTP is that it requires you to enable Remote Login (SSH) on your Mac. I’ll talk more about Remote Login in the next chapter, but for now you simply need to understand that it provides remote users with a console connection and basically allows them to do anything they could do using Terminal while seated at your Mac. For non-admin users this isn’t too much of a concern, but an admin-level user could wreak havoc (for example, by enabling the root account and then logging in as root, where they would have unfettered access to your system). I’ll show you a way around this risk under “How Do I Configure It?”

What Does It Share?

SFTP provides the same level of access to the same directories as the default configuration of FTP Access. However, note that if you’ve edited the various FTP configuration files to provide more or less access over FTP, SFTP does not honor those changes.

Who Can Access Files?

Just like FTP, when SFTP access is enabled anyone with an account on your computer can connect via SFTP. They’ll be able to access files from any platform (Windows, Mac, or Unix).

How Do I Configure It?

Contrary to what you might think, to enable SFTP you don’t have to enable FTP Access. Rather, you enable Remote Login in the Services tab of Sharing preferences. However, as I mentioned above, this also enables SSH, which allows any user on your computer to issue Terminal commands remotely. Here’s how you prevent this for certain users.

Disabling SSH Access (While Still Allowing SFTP)

I’ll talk more about Remote Login in the next chapter, and about default shells in Chapter 15, but for now suffice it to say that when a user logs in remotely using SSH (secure shell), their default shell is loaded. The shell is how they work with the Terminal’s command line, and using it they can access almost any command-line application (including the sftp utility). In addition, each user has a configuration setting that determines what their default shell is (there are several different popular shells that can be used). Using these two facts, you can edit a user’s account settings so that instead of a shell, only the Unix sftp application itself is loaded—thus allowing the user to use SFTP remotely, but disallowing any other remote activity. Here’s how:

  1. If Remote Login is enabled, disable it in Sharing preferences.

  2. Open NetInfo Manager, and authenticate by clicking the padlock icon.

  3. Using the directory browser in NetInfo Manager (not in the Finder), navigate to /users/username, where username is the user for whom you want to restrict access to just SFTP. Select that username.

  4. In the Property/Value(s) list, scroll down to the shell property. Double-click the corresponding entry in the Value(s) column (which will most likely be /bin/bash or /bin/tcsh) to make it editable.

  5. Delete the existing value, and type /usr/libexec/sftp-server in its place (Figure 10.5).

  6. Choose Domain Ø Save Changes to save your changes, and then quit NetInfo Manager.

  7. Re-enable Remote Login in Sharing preferences.

What you just did was tell OS X that when the user logs in, the default shell it should load is sftpserver, which isn’t really a shell. Since the sftp-server application is the command-line utility used to access files via SFTP, the user will still be able to access files (either using the command-line or a graphical SFTP client, as described in "How Do Others Access Files?"), but they won’t be able to do anything else.

Figure 10.5: Using NetInfo Manager to limit a user’s Remote Login capability to SFTP
Note

The downside to this procedure is that as long as the user’s default shell is set to sftp-server, they won’t be able to use Terminal or perform any type of command-line activity, even if they’re sitting at your computer. You can easily edit their account in NetInfo Manager to restore their default shell when needed, but this tip is useful mainly for remote users who have no use for full shell access.

How Do Others Access Files?

Just as with FTP, users will be able to access files via SFTP using any SFTP client. (In fact, many FTP clients also support SFTP; however, you need to specifically tell them to use SFTP instead of FTP when connecting.) In their SFTP client, they should enter your IP address or domain name as the server address and use their username and password on your computer as their login name and password.

Alternatively, since SFTP uses the command-line application sftp, just like FTP uses ftp, users can connect through a terminal or console application by using the command sftp yourIPaddress <RETURN>, at which time they’ll be prompted for their username and password. Once they’re logged in, they can use sftp commands to access files.


Sharing Remotely: Windows File Sharing (SMB)

User Level | admin
Affects | computer
Terminal | no

Sharing files on your Mac with Windows computers has always been a bit of a hassle, especially for your Windows friends. Without installing third-party software, their computers don’t understand the Apple Filing Protocol (AFP) used by Personal File Sharing, and FTP requires them to use a special FTP application or the command line—it’s just not as convenient for them as accessing files on other Windows computers. Wouldn’t it be great if they could mount your shared folders like any other Windows share?

Starting with OS X 10.2, Apple included a version of the open-source Samba server (http://www.samba.org/), which shares files using the Server Message Block/Common Internet File System (SMB/CIFS) protocol—the same protocol used by Windows for sharing files. Using Samba (known in OS X as Windows File Sharing) you can make your files available to Windows users (and Unix computers that understand SMB/CIFS), and your shares will appear to their computers as any other Windows volume or share.

What Does It Share?

By default, users can only access their own home directory (/Users/username) via Windows File Sharing. In fact, when they connect, their home directory will be mounted as a shared volume. So in order to share a file with someone who is logging into your Mac through Windows File Sharing, you’ll need to place the file in their Public folder (via the Drop Box), not yours. Likewise, for them to share a file with you when they’re connected remotely, they’ll need to place it in their own Public folder, since that’s the only location both of you can access.

That being said, it’s possible to share other directories and to share them with more than a single user. I’ll show you how under “How Do I Configure It?”

Who Can Access Files?

In order to connect to Windows File Sharing and access files, users must have an account on your Mac. (If you’re running OS X 10.2, an admin user must manually enable their account to allow Windows File Sharing access, as explained in the next section.)

Tip

Obviously, users can connect to Windows File Sharing from a Windows computer. They can also connect from a Unix or Linux computer that supports SMB/CIFS. However, they can also connect from another computer running Mac OS X 10.2 or later (I’ll show you how in the next chapter when I talk about connecting to Windows shares). Thus, if you’re sharing files with both Windows and Mac OS X users, you can use Windows File Sharing for both—you don’t have to turn on Personal File Sharing just for the Mac folks unless you want to take advantage of Personal File Sharing features.

How Do I Configure It?

Much like the other sharing services covered here, to enable Windows File Sharing, you select Windows File Sharing in the Services tab of Sharing preferences and then click the Start button (or simply check the box next to Windows File Sharing).

Note

If you’re using OS X 10.2, there’s actually a second step that’s required—you must enable/disable the ability to connect to Windows File Sharing for each user individually. Open the Accounts pane of System Preferences and select a user. Click the Edit User… button, and in the resulting window check the box next to “Allow user to log in from Windows.” Unfortunately, this requires you to enter a new password for the user. If you know the user’s password (or if it’s your own account), you can simply re-enter the current password. If you don’t, just enter something easy to remember, give the new password to the user, and then let them change it back.

In addition to the standard Windows File Sharing setup, you can customize Samba to provide access to other files and folders and to allow guest access. Although you could manually configure the Samba settings file (/etc/smb.conf), SharePoints—which I discussed earlier as a way to configure Personal File Sharing options—provides you with a friendly interface for changing a good number of Windows File Sharing options. Here are a few examples.

Tip

If, after reading the tips I include here for configuring Windows File Sharing, you decide that you really want to become a Samba pro, an entire copy of the book Using Samba is actually included with Mac OS X. You can view it by opening the file /usr/share/swat/using_samba/index.html in your Web browser. A newer version of Using Samba is available as an actual book, but the information in this free, older version is still extremely useful for understanding the nitty-gritty behind Samba. In addition, if you’re using OS X 10.2, another third-party utility called Samba Sharing Package (http://xamba.sourceforge.net/ssp/index.shtml) provides a number of options not available via SharePoints, although it takes a bit more work to install and use.

Creating File Sharing Only Users

If you’re sharing files with users of Windows computers, there’s a good chance that some of those users will never use your computer locally (i.e., they’ll never need to sit down in front of your computer and log in). If it seems like overkill to create full accounts for Windows File Sharing users, you can create File Sharing Only users. These accounts can only connect to Sharing services; they can’t log in locally. I explained how to create such accounts using SharePoints earlier in the chapter when I discussed Personal File Sharing. If you’ve already set up one or more File Sharing Only accounts using those instructions, you’re set—they work for Windows File Sharing, as well. If you want to create additional File Sharing Only users, or haven’t previously created any such accounts, follow those instructions. (You can find them under “Creating File Sharing Only Users” in the “Sharing Remotely: Personal File Sharing” section—also note the tip in that section about preventing File Sharing Only users from appearing at the OS X login screen).

Note

I mentioned earlier in this section that, by default, users can only access their own home directories when connected via Windows File Sharing. In the case of File Sharing Only users—who have no home directories—this means that unless you’ve created additional shares, they can’t access any files or folders on your computer. To provide such users with access to files, you’ll need to create additional shares (shared directories), as described below.

Sharing Additional Directories via Windows File Sharing

To provide users with access to files and folders outside of their own home directories, you need to create additional Windows File Sharing shares. Luckily, SharePoints, which I showed you earlier in this chapter as a way to share additional directories for Personal File Sharing, makes this process easy for Windows File Sharing, as well. (If these instructions look familiar, it’s because they’re nearly identical to the steps used for Personal File Sharing.)

Tip

When creating new shares, it’s much safer to create separate shares for individual folders than to share an entire drive or a folder that contains sub-folders you don’t want to share.

  1. Click the “Normal” Shares tab.

    1A. If you’ve already created a share for Personal File Sharing, and you simply want to enable Windows File Sharing for that share, select it from the list of shares, choose “Shared (+)” from the Windows (SMB) Sharing pop-up, and then click the Update Share button; provide your username and password if prompted. You’re done. If you’re instead creating a new share, proceed to Step 2.

  2. In the Share Name field, enter the name of the share. This can be the name of the folder you plan to share or anything else. However, since this name will be included in the list of shares users see when they connect to Windows File Sharing, it should be something unique and descriptive.

  3. Click the Browse… button next to the Directory field. Navigate to the folder you want to share, select it, and then click the Open button. The path to your chosen folder will appear in the Directory field.

  4. From the Windows (SMB) Sharing pop-up menu, choose “Shared (+).”

  5. Click Create New Share to create the share; if prompted, enter your username and password.

Just as you can with Personal File Sharing, you can delete a share by selecting it from the list of shares and then clicking Delete Selected Share. You can also change the permissions of the shared directory by selecting a share and then clicking the Show File System Properties button; just be sure to click the Update Share button afterward. (Note the caveats on changing permissions in this manner that I mentioned earlier in this chapter when I talked about Personal File Sharing.)

Tip

To disable Windows File Sharing access for a custom share without deleting it, select the share in the list of Normal shares, choose “Disabled (-)” from the Windows (SMB) Sharing pop-up menu, and then click Update Share.

Changing Windows File Sharing Server Properties Using SharePoints

In addition to allowing you to customize the access to shares provided via Windows File Sharing, SharePoints also allows you to customize the Samba (SMB) server itself in a number of ways. You do this via SharePoints’ SMB Properties tab. This tab provides a pop-up menu with three groups of settings: General Properties, File Visibility, and Home Directories. Because these settings can affect how users connect and what access they have once connected, I’m going to quickly describe each of them. After making any changes to settings here, be sure to click the Update Samba (SMB) Server Properties button to save your changes.

Note

As I mentioned earlier, when you use SharePoints—or any other utility—to customize the Windows File Sharing server, you’re actually editing the Samba settings file (/etc/smb.conf).

General Properties This screen lets you customize the way in which your Mac shows up via SMB/CIFS connections (see Figure 10.6).

Server NetBios Name The name Windows computers will see when locating your Mac on the network.

Max Connections The maximum number of users that can connect via Windows File Sharing at one time. If you leave this blank, no limit is set.

WorkGroup The network Workgroup in which your Mac will appear (“workgroup” by default). It’s easier for Windows users to find your Mac on the network if your Workgroup name is the same as theirs. Note that if your Mac is on a Windows NT network, your workgroup name must be the same as the NT Workgroup, or else Windows users will not be able to connect.

WINS Server A WINS server is like a Domain Name System (DNS) server for a local Windows network. If you know that your network uses a WINS server for local name resolution, enter the address or name of the WINS server here. Otherwise leave this field blank.

Server Info String A short bit of text about your computer that Windows users will see in My Computer after connecting.

Security Method This setting determines whether your Samba server uses “user-level” or “share-level” security. Unless you have a specific reason to use share-level security (and you understand how to configure Samba to do so), you should choose USER (which is the default).

Tip

You can also change your Workgroup and WINS Server names using the Directory Access utility (inside /Applications/Utilities). After authenticating and providing your admin username and password, select SMB and click Configure… Type the new Workgroup name (or select it from the drop-down menu if applicable), change the WINS Server name (if desired), click OK, and then click the Apply button to save the change. Then stop Windows File Sharing and start it again (in Sharing preferences).

File Visibility This screen lets you hide certain files (or types of files—for example, MP3s or JPEG pictures) from Windows File Sharing users or prevent them from being accessed altogether. (Note that this screen only applies to files inside Windows File Sharing shares—any files and folders outside of those shares will remain off-limits, no matter what you do here.)

Hide Files If you want certain files to be hidden, type their names in the Hide Files field; to include multiple files, separate their names with a slash (/).

Veto Files A knowledgeable user, or one who has simply tweaked their computer to display hidden files, can still view and access the files listed in the Hide Files box. To prevent these users from even detecting the existence of a file, type its name in the Veto Files field instead. (Again, separate multiple filenames with /.)

Tip

You can use the asterisk (*) symbol as a “wildcard” in the Hide Files and Veto Files fields. For example, to prevent Windows File Sharing users from being able to access JPEG graphics, type *.jpg in the Veto Files box.

Hide Files Starting with a Period If enabled, this setting hides any files whose name begins with a period (.)—in other words, any file that would normally be invisible in Mac OS X because it starts with a period—from Windows users. I highly recommend enabling this option, as otherwise Windows users will see lots of “clutter” when they connect to your computer via Windows File Sharing.

Home Directories This screen lets you determine the level of access Windows File Sharing provides to each user’s own home directory.

Shared If this box is unchecked, users will be unable to connect to their home folder. They will only be able to connect to additional shares that you’ve created. (This means that if you haven’t created any additional shares, and this box is unchecked, users will not be able to access any files at all.)

Browseable If this box is checked, users will be able to access their home directory by simply connecting to your computer (as described in the next section) and then choosing their home directory from a list of shares. If this setting is disabled, users will need to connect directly to their home directory, using their short username as the share name.

Read Only If this setting is enabled, users will be able to connect to their home directory, and open and copy files from it, but they won’t be able to save changes to files, nor will they be able to copy files to it.

Click To expand
Figure 10.6: SharePoints allows you to configure various properties for your Windows File Sharing server.

Alternatives to Windows File Sharing

If your Mac is on a Windows network, or if you find yourself a heavy user of Windows File Sharing, you might want to consider the commercial software DAVE (http://www.thursby.com/). DAVE is a full-featured Mac/Windows file and print sharing package that provides a good deal of additional functionality in terms of sharing files with and connecting to Windows computers. For example, DAVE provides additional levels of access security, provides a simpler procedure for setting up additional shares, allows you to share your printers with Windows computers, and works with the NTFS file format used by Windows servers. It also provides additional features with respect to connecting to Windows shares, which I’ll mention in the next chapter when I talk about how to connect to Windows shares from OS X.

How Do Others Access Files?

How Windows users will access your Mac depends on whether they’re on the same local network as you or if they’ll be connecting over the Internet.

Local network If you’re on the same local network as your Windows users, they should simply open Network Neighborhood (My Network Places on Windows XP); if you’ve set up your Workgroup to be the same as theirs, your computer should show up immediately. (If your Work- group differs, they’ll need to open Entire Network and find your Workgroup name first.) When they open your computer, they’ll see the shares they can access. To open a share, they’ll need to provide their username and password.

Internet If Windows users are trying to access your Mac over the Internet, they’ll have to use a technique similar to the one used for accessing your iDisk:

Windows XP Open My Computer, and then choose Tools Ø Map Network Drive. Enter \\yourIPaddress\sharename (where sharename is the name of the share on your Mac that users are trying to access). When prompted, they should provide their username and password for your computer, not their own.

Windows 2000 Open My Computer, and then choose Tools Ø Map Network Drive. Click “Web folder or FTP site,” and then enter the address provided above.

Windows 98/ME Open My Computer, open the Web Folders icon, and then double-click Add Web Folder. Enter the address provided above.

Note

Windows 95, 98, and ME don’t allow users to connect to an SMB share using a username/password that differs from the account being used on the Windows computer. This means that you may need to create an account (normal or File Sharing Only) that has the same username and password as the Windows user’s own computer if you want that user to be able to connect via Windows File Sharing.

Start Sidebar
Network File System (NFS) Sharing (and Connecting)

As a Unix-based operating system, OS X also supports the Network File System (NFS) protocol, a common method for sharing files between Unix systems. Unfortunately, NFS sharing isn’t enabled by default in OS X. (A major reason is that nowadays most Unix computers support SMB/CIFS, so they should be able to access Windows File Sharing.) In addition, enabling NFS sharing is a fairly complex procedure. However, if you have a need for sharing files with non–OS X Unix computers, and those computers can’t access SMB/CIFS shares, NFS may be your only option.

Although I don’t have the space to discuss NFS sharing and connecting here, I want to direct you to a couple of resources that can help you out. The shareware NFS Manager (http://www.bresink.de/osx/NFSManager.html) takes the pain out of the process by providing an Aqua (graphical) interface for setting up NFS sharing and for connecting to NFS shares on other Unix computers. In addition, the NFS Manager website contains an excellent guide to using NFS Manager (http://www.bresink.de/osx/DocsNFSManager/index.html) that also provides detailed background information on NFS.

End Sidebar


Sharing Remotely: Personal Web Sharing

User Level | admin
Affects | computer
Terminal | no

The final way that OS X shares files is via the Web. OS X provides a complete install of the industrial-strength Apache Web server (http://www.apache.org/)—the same one used by many of the biggest websites on the Internet. Although it may sound a bit strange to include a Web server as a way to "share" files, that’s exactly what you’re doing: allowing other users to access files on your computer. And since Apple includes Personal Web Sharing in the Sharing pane of System Preferences, I’m going to treat it like a sharing service.

What Does It Share?

Personal Web Sharing actually shares at both the user level and at the computer level. More specifically, it can share the contents of each user’s /User/username/Sites folder, as well as the contents of /Library/WebServer/Documents. I say can share because OS X is configured, like most Web servers, to not show the contents of directories; rather, you can only access a file if you have its complete file name or if it’s linked from another Web page that you can view. By default, unless someone accessing a website on your Mac knows the URL of a specific file, all they’ll be able to see is the file index.html or home.html—the default page for any website—at the root level of your Sites folder or the main Web Documents folder.

Note

Since Personal Web Sharing is intended to be a way to share a website over the Internet, each user’s Sites folder and the main Web Documents folder have basic websites pre-installed. You can view these default websites if you enter http://localhost/ (for the main Documents folder) or http://localhost/~username (for any user on your Mac) in your browser’s address field (Figure 10.7). (localhost tells your browser to access the local Web server.) If you replace these default website files with your own website, people around the world can view that site by pointing their Web browser to your Mac.

Click To expand
Figure 10.7: A default user web- site in OS X

However, even though the main purpose of Personal Web Sharing is to share websites, you can also use it as a way of sharing other files, as well. Any file that you place in your personal Sites folder will be available to anyone who has the full address of that file. For example, if you put a document called report.doc in your Sites folder, you can tell your coworker to enter http://yourIPaddress/~yourusername/report.doc in their Web browser, and that file will be downloaded to their computer. At the same time, no one else will know that file even exists. The disadvantage (or advantage, depending on how you look at it) of Personal Web Sharing is that unless you’re a Web server guru who knows how to trick out your Apache installation, users can only download files from you; they can’t upload files. However, Personal Web Sharing can be a very quick and convenient way to provide someone with access to a file without having to give them a user account or to configure any other services.

Tip

Unless you’ve purchased your own Internet domain and have it assigned to your personal Mac, I recommend using your personal Sites folder for sharing files and websites. The /Library/WebServer/Documents folder can be used, but it’s generally intended for computers that are used as dedicated Web servers, and placing files there requires admin access.

Who Can Access Files?

Although it’s possible to configure Apache to require usernames and passwords to access files, by default Personal Web Sharing doesn’t limit access to particular users, nor does it require any passwords. Thus anyone with a Web browser can access the files in your Sites folder or the main WebServer Documents directory. However, as I mentioned above, unless you purposely link to files (by editing the index.html file or creating your own, including URL links to other files and Web pages in your Sites folder), only those users who know the exact URLs to specific files will be able to access them.

How Do I Configure It?

To enable Personal Web Sharing, you just need to check the box next to Personal Web Sharing in the Services tab of Sharing preferences (or select Personal Web Sharing and click the Start button). Apache will start up, and you’ve got a Web server every bit as powerful as many of the major sites on the Internet.

Other Configuration Options

Because Personal File Sharing is actually a complete installation of the Apache Web server, it’s incredibly configurable and extendable. It’s possible to configure Apache so that specific files and folders inside the various Web document folders require usernames and passwords. You can install PHP or use CGI scripts. Pretty much anything that can be done with a Web server can actually be done on your Mac. Unfortunately, I don’t have the space to show you all the cool things you can do with Apache, but I encourage you to browse the full Apache manual installed on your computer; you can access it by pointing your Web browser to http://localhost/manual/. In addition, O’Reilly’s "macdevcenter" has an excellent collection of articles on using Apache in Mac OS X that can be browsed at http://www.macdevcenter.com/pub/a/mac/collections/webserving.html.

Warning

Most of the tweaks and changes you make to Apache are done within the file /etc/httpd/httpd.conf. Sometimes Mac OS X system updates install a new version of this file that provides additional or different Apache functionality. Unfortunately, if this happens, you lose all of your customizations. To be safe, you should be sure to back up this file before installing any system updates (assuming you aren’t backing it up as part of your normal backup strategy). If a system update removes your edited version, you can use the backup copy to add your customizations to Apple’s newly installed version. (In fact, it’s a good idea to always make backups of any .conf file that you manually edit, just in case something like this happens.) The good news is that newer versions of Apple’s installer will often back up the existing file. For example, the 10.2.4 update renamed the existing file as httpd.conf.applesaved, and newer installers supposedly leave your custom httpd.conf file alone if it’s been modified, creating a new default file called httpd.conf.default.

How Do Others Access Files?

If you’re simply using Personal Web Sharing to share individual files with remote users, you’ll need to give them the precise URL of each file: http://yourIPaddress/~yourusername/filename. If you’ve created sub-folders inside of your Sites folder, the address to files inside those folders would be http://yourIPaddress/~yourusername/foldername/filename. By entering the URL to a file in their Web browser, the file will be downloaded to their computer.

If you’re actually using Personal Web Sharing as a Web server, you should give other people the URL of http://yourIPaddress/~yourusername/ to allow them to view your website (assuming you’ve followed the standard of using index.html or home.html as your website’s home page). You could also give them the specific address of any other Web page in your Sites directory.

Tip

If you’re new to HTML and Web pages, check out the default index.html Web page inside your personal Sites folder (type http://yourIPaddress/~yourusername/ in your Web browser). It gives you a quick primer on using your Sites folder for a website.


Quick Access to Sharing Services

User Level | admin
Affects | computer
Terminal | no

If you’re really getting into this whole sharing thing, and you find yourself frequently opening System Preferences just to enable or disable one or another Sharing service, you’ll appreciate the freeware SharingMenu (http://www.mani.de/sharingmenu/). When launched, it provides a small menu in the menu bar that allows you to toggle each Sharing service on or off (Figure 10.8). If you’re running OS X 10.2, it also lets you quickly enable and disable Guest Access to Personal File Sharing, which can be a real convenience if, like me, you normally keep Guest Access turned off but occasionally turn it on for a few minutes to share a file with someone. (Remember: if you drag SharingMenu to your Login/Startup Items list in System Preferences, it will launch automatically at login.)

Figure 10.8: SharingMenu gives you quick access to Sharing services.


Moving On...

Team LiB

Moving On…

Now that you’re an expert at sharing files with other users, you may be wondering exactly how to connect to other computer or servers (or even to your own Mac from another location). In the next chapter I’ll cover Mac OS X’s various methods for connecting to shares and servers. I’ll also talk about ways in which you can connect to and control your Mac from afar.


Chapter 11: Connection Convenience and Remote Control

(Or: Access files on other computers, and control your home computer from the beach house.)

Overview

In addition to being the most flexible OS around for sharing files and data, Mac OS X is also the most compatible when it comes to connecting to servers and shared files. Plus, as both a Unix OS and a Mac OS, it provides several options for remote access and control.

In this chapter I’ll show you how to connect to virtually any type of remote server and share you’ll encounter. If you find yourself connecting to the same computers or shares often, I’ll also show you how to streamline the connection process. Finally, I’ll show you some of the options available for connecting to your own computer, and controlling it, from afar.

Note

As with the previous chapter, I’m going to assume that you have Internet access and that you know how to configure your Mac to connect to the Internet or local network.


IP Addresses, URLs, and Ports

Before I get started with connection strategies, I want to cover a topic that will make the rest of the chapter much easier to read and use, and that’s the issue of the address you use to connect to another computer. Most of the sections in this chapter have one thing in common: You’re connecting to another computer over a network (LAN, WAN, or the Internet). To make such connections, you need to know the IP (Internet Protocol) address or domain name of the target computer. You also need to understand how to provide that address. Here are some issues to be aware of when dealing with IP addresses, URLs, and ports.

What’s the Address?

Every computer on the Internet has its own IP address that uniquely identifies it (much like a street address for a residence). These IP addresses are formatted as x.x.x.x, where each x is a number between 0 and 255, and connecting to another computer involves providing its address to your own computer so that it knows the exact destination it’s attempting to reach. This means that if you’re trying to connect to another computer or server over the Internet, you need to make sure you have the correct IP address.

Note

In many cases (especially on the Web), you don’t have to remember the actual numerical address; you only have to provide a domain name (e.g., cnn.com, apple.com, whitehouse.gov), and your computer and the Inter- net’s Domain Name System (DNS) servers work together to figure out the actual IP address for you.

Note

The x.x.x.x address mentioned in the main text is called an IP4 address. A newer type of address called an IP6 address is starting to come into use on the Internet. These addresses have the format of xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx, and are supposedly the “future” of IP addresses. However, at the time of this writing, and for the foreseeable near future, they’re fairly rare for most users.

Unfortunately, there are a few wrinkles when it comes to IP addresses, such as issues with Internet routers and dynamic IP addresses. (I covered these issues in the previous chapter.) As the person connecting to another computer, these issues don’t affect you as much—it’s the responsibility of the server’s owner/administrator to figure them out and to simply provide you with an IP address that works. However, I mention the issue here because if for some reason you can’t connect to a remote computer, you should keep in mind that the reason might actually be a problem with the IP address you’ve been given (i.e., it might not be your fault).

Finally, if you’re connecting to another computer on a local network and both computers are behind an Internet router, there’s a good chance the other computer will have what is known as an internal or local IP address. These addresses—in the format of 10.x.x.x, 172.16.x.x, or 192.168.x.x— aren’t used for Internet communication; they’re reserved for traffic inside a local network.

Note

If you’re lucky enough to be on a local network with other Rendezvous-capable computers, you won’t have to worry about IP addresses or domain names. In most cases connecting is as simple as clicking a computer’s name in a dialog.

URLs: Not Just HTTP

Anyone who has surfed the Web has seen plenty of URLs—the addresses of Web pages. However, most users are unaware of what that URL actually signifies and that URLs aren’t at all specific to the Web.

A URL (Uniform Resource Locator) is a string of characters, in a specific format, that provides a standardized way of locating a resource (such as a file). Although URLs are most commonly used for websites and Web pages, they were designed to be extremely versatile and as such are used for many different types of computer-to-computer connections (and sometimes even for accessing files on your own computer). In fact, as I show you how to connect to various types of sharing services, you’ll find that in many cases Mac OS X expects you to use URLs. What’s more, as you’ll discover later in this chapter, once you get the hang of URLs you’ll find that you can use their standardized nature to your advantage by creating Internet Location files as shortcuts.

The official format of a URL is protocol://server:port/directory/file. Here’s what each part means:

protocol The protocol can be HTTP (hypertext transfer protocol, for websites), FTP (file transfer protocol, for FTP servers), SMB (server message block, for Samba file servers), AFP (Apple Filing Protocol, for servers using Apple’s Personal File Sharing), FILE (for local files), or one of a number of other methods in which data is transferred over the Internet.

server The IP address or domain name of the computer hosting the resource you’re attempting to access.

port The specific port on the server that handles the service you’re accessing. As I mentioned in the previous chapter, because a single computer can provide multiple services (Web serving, e– mail, file sharing, etc.), each service is assigned a specific port number(s). These ports aren’t physical ports (such as Ethernet, modem, and USB ports); rather, they’re a way to divide different types of network traffic and route them to the appropriate services on a computer. For example, on most computers a connection to port 80 tells the host computer that the connecting computer is attempting to access a Web page. To make things easier for users, almost every type of Internet service has a default port; if a port isn’t included in a URL, the default port is assumed. (See http://www.iana.org/assignments/port-numbers for a list of default ports.) For example, if you enter a Web URL into your browser but don’t include port 80, your browser automatically includes :80 in the URL when it sends a request to the Web server. (See "Servers and Alternate Ports," below, for what to do when a server uses a nonstandard port.)

directory and file Much like the path to a specific file on your computer, the /directory/file portion of a URL tells the server exactly which directory and/or file you want to access. If no path is included, the server automatically directs you to a specific directory or file (depending on how the server is set up).

Tip

It’s possible, when connecting to some servers, to include your name and password in the URL. For example, if you’re connecting to a website for which you have a user account, you can often include your name and password in the URL like this: http://username:password@server/path/. I’ll talk more about this feature later in this chapter in "Using Internet Location Files." (Note that including your username and password is generally risky when it comes to websites, since Web URLs are almost always sent over the Internet in plain text. It’s better to connect and then provide your name/password, as many servers have the ability to communicate securely after the initial connection.)

Note

For more information about URLs, check out http://www.w3.org/Addressing/rfc1738.txt.

Servers and Alternate Ports

I mentioned that most Internet protocols communicate over default port numbers. This ensures that computers are able to communicate easily. For example, FTP generally uses ports 20 and 21, HTTP uses port 80, and Apple’s Personal File Sharing uses ports 427 and 548. However, there are times when a server may use a different port than expected. For example, as mentioned in the previous chapter, some Internet service providers block standard file sharing/FTP ports to prevent users from sharing files over the Internet. As another example, some network administrators use firewalls to block all but the “essential” ports (Web and e–mail, for example) to increase network security. To get around such restrictions, the owner of a server can manually configure service(s)to use different port(s). If this is the case, they will most likely provide you with the correct port to use, and you should include the port number in the URL as described above.

Servers Simplified

Now that you understand what kind of address or domain name, and possibly port number, you need in order to connect to another computer, to make the rest of this chapter easier to read I’ll refer to that address or domain name simply as the server address. For example, if I say that to connect to Personal File Sharing on another Mac you need to type afp://serveraddress/, this means that you should replace serveraddress with the appropriate IP address or domain name of the computer to which you’re trying to connect (including the port number, if the service on the target computer is using a non- standard port). This will save me a lot of repetitive explaining, and you a lot of confusion, later in the chapter.


Connecting to Shares on Other Computers/Servers

User Level | any
Affects | individual user
Terminal | no

In the previous chapter, I showed you how to configure your Mac to share files with other users, and how those other users can connect to your computer. In this section, I’ll explain how you can use Mac OS X to connect to other shares and servers. In some situations the procedures are identical; however, in other instances the procedures are much different.

Note

In all of the examples I include here, I assume that you have an account that provides you with access to the share or server to which you’re connecting (or that the server allows guest access), and that you have the IP address or domain name of the share or server. When I refer to your username and password, I’m talking about your username and password for the share or server, not your Mac OS X username and password for your own computer (unless, of course, you’re connecting to your own Mac from another location).

Mounting and Unmounting Shares/Volumes

When you connect to a remote share/volume (after providing your username and password, if applicable), the share will generally be mounted in the Finder. This means it will appear on your computer as an accessible volume. However, where it appears depends on how you have your preferences set up. At a minimum, it will usually appear in the Computer view in Finder windows. (I say usually because there are even exceptions here, as I explain in the sidebar "Network Browsing versus Connect To Server: OS X 10.3.0–10.3.2.) However, depending how you’ve set up the General and Sidebar screens of Finder preferences, the share may also appear on the Desktop and/or in the sidebar of Finder windows.

When you’re done using a remote volume/share, you’ll usually need to unmount it. You can generally do this in one of three ways. The first is to select the share in the Finder and “eject” it by either (1) dragging it to the Trash; (2) choosing File Ø Eject; or (3) clicking the Eject toolbar item (if enabled). The second is to control/right-click the share’s icon and choose Eject “sharename” from the resulting contextual menu. Finally, if you’ve chosen, via Finder preferences, to show “Connected servers” in Finder sidebars, remote shares that are mounted will have an eject button next to them in the sidebar; click the eject button to unmount the share.

Start Sidebar
The Connect To Server Dialog

In many of the connection procedures I discuss in this chapter, you’ll need to use OS X’s Connect To Server dialog (by choosing Go Ø Connect to Server…, or pressing command+K, in the Finder), which provides a way for you to connect to other computers, both locally and over the Internet. (Keep in mind that Server is really just Mac OS X’s way of referring to a computer that’s sharing files for other computers to access. A server could be a high-end file server, or it could be someone’s PC in their home, set up to share files.)

When you select the “Connect to Server…” menu item in the Finder, you’re presented with the Connect To Server dialog (shown in the graphic below). To connect to another computer or server, you enter its URL in the Server Address field (using the format described earlier in this chapter, including the protocol—AFP, FTP, SMB, etc.). The “clock” pop-up menu to the right lists Recent Servers (those to which you’ve recently attempted to connect), and the Favorite Servers box lists your, well, favorite servers (those you’ve manually added to your Favorite Servers list using the plus (+) button—which symbolizes “Add to Favorites”). Choose a Recent Server from the pop-up menu, or select a Favorite Server from the list, to have Mac OS X automatically enter it into the Server Address field. (I talk more about Favorite and Recent Servers below.)

In addition, you can click the Browse button to open a new Finder window in the Network view (which I talk about several times in this chapter).

Once you’ve typed in a server address or selected a Favorite or Recent server, click Connect to initiate a connection. What happens after you click Connect depends on the type of server to which you’re connecting; I’ll talk more about the process used for each in other parts of the chapter.

Favorite and Recent Servers

If you want to add a server as a Favorite, type its address in the Server Address field and then click the Add to Favorites (+) button before you click the Connect button. (It’s not even necessary to connect, in fact.) If you want to remove a Favorite Server, select it in the Favorite Servers list and then click the Remove button; it will be removed immediately. Alternatively, you can use the Finder to go to ~/Library/ Favorites. You’ll notice that each Favorite is simply a Mac OS X Internet Location file located inside this folder; if you drag one to the Trash, it will no longer show up in the list. (I’ll show you how to use this design to your advantage later in the chapter in "Using Location Files as Recent Servers and Favorites.")

As I mentioned, once you attempt to connect to a server, that server is listed in the Recent Servers (“clock”) pop-up menu. Although there’s a Clear Recent Servers… command in that menu (which removes all recent servers), unfortunately there’s no command to remove individual servers from the menu. Fortunately, Recent Servers are stored in exactly the same way Favorite Servers are; go to ~/Library/Recent Servers in the Finder and you’ll find an Internet Location file for each Recent Server. Drag unwanted Location files to the Trash, and their corresponding server addresses will no longer show up as Recent Servers.

The OS X 10.2 Connect To Server Dialog, and Accessing It in OS X 10.3

The Connect To Server dialog in OS X 10.2 is slightly different from the 10.3 version. Instead of a Recent Servers pop-up menu and a Favorite Servers box, it provides a single At pop-up menu that lists both.

In addition, it contains a disclosure triangle (like the one found in Open/Save dialogs) that expands the dialog to provide a two-column server browser. Clicking a workgroup, zone, or group in the left column shows available local servers on the right. Some users prefer this approach to OS X 10.3’s Network view.

If you’ve upgraded to OS X 10.3 from 10.2, and you miss the 10.2 version of the Connect to Server dialog, here’s how to get it back:

  1. Open the Script Editor application (/Applications/AppleScript/Script Editor).

  2. In a new Script Editor window, type open location (choose URL) with error reporting (don’t type an actual URL; type choose URL).

  3. Save the new script (using a File Format of Script in the Save dialog) to ~/Library/Scripts. Call it something like 10.2 Connect to Server.

If you’ve enabled the Script Menu as described in the Online Supplement of Chapter 5, you can now access the OS X 10.2 Connect to Server dialog by selecting your new script from the Script Menu. In fact, when accessing this version of the dialog from OS X 10.3, it even has more functionality than it did under 10.2— namely, a Show pop-up menu that lets you view only certain types of remote devices in the server browser.

End Sidebar

Connecting to iDisks

As I mentioned earlier in the book, you can connect to your own iDisk using the Finder’s Go Ø iDisk Ø My iDisk command (which accesses the iDisk corresponding to the .Mac member name and password in the .Mac tab of .Mac preferences); using iDisk Utility’s Open iDisk screen; or using the Finder’s iDisk toolbar and sidebar items. However, what if you want to connect to another user’s Public Folder? What if a friend or colleague has given you “full” access to their iDisk (which requires you to provide their member name and password)? What if you have more than one iDisk of your own? Here are the other ways in which you can connect to iDisks, which are significantly expanded under OS X 10.3.

Note

As I explained in Chapter 10, Apple’s iDisk servers use the World Wide Web Distributed Authoring and Versioning (WebDAV) protocol, which is an extension of the HTTP protocol used for Web sites. One benefit of WebDAV is that an iDisk stays mounted until you manually disconnect/umount it, even when you aren’t actively using it. For more info on WebDAV, visit http://www.webdav.org/.

Tip

If you find yourself connecting to WebDAV servers besides iDisks, you’ll find the freeware WebDAV client Goliath (http://www.webdav.org/goliath/) to be a great tool. (I mentioned Goliath in Chapter 10 as a way for OS 9 users to access iDisks, but there’s also an OS X version.)

Connecting to iDisk Public Folders

Apple provides three ways to access iDisk Public Folders. The first, and simplest, is to choose Go Ø iDisk Ø Other User’s Public Folder… from the Finder. Type the .Mac member name of the owner of the iDisk and click Connect (Figure 11.1); the Public folder of that iDisk will be mounted in the Finder (generally as “membername-Public”).

Note

In all three methods discussed here, if the iDisk’s owner has set a password for their Public folder, you’ll see a password dialog before the Public folder is mounted; type public for the name (if requested) and then the password; click OK to complete the connection. Note that depending on how the owner has set up the Public folder, you may be restricted to Read Only access.

Figure 11.1: The Finder’s “Other User’s Public Folder” connection dialog lets you easily connect to iDisk Public folders.

The second method is to launch iDisk Utility (discussed in Chapter 7) and use the Open Public Folder screen. Type the member name of the iDisk’s owner, and then click Open to mount the Public folder. The advantage of using iDisk Utility is that it remembers previous Public folder connections; you can quickly connect to these iDisks by selecting a member name from the pop-up menu just to the right of the Member Name field.

Finally, you can also connect to iDisk Public folders using the Connect To Server dialog; to do this, type http://idisk.mac.com/membername-Public or http://idisk.mac.com/membername/Public (where membername is the user’s .Mac member name), and click Connect. (If you’re wondering what the difference is between the two URL formats, in OS X 10.3 and later, there is none. However, in OS X 10.2, membername-Public causes the Public folder to be mounted with the owner’s name visible; this is helpful if you access more than one Public folder at a time because you can quickly see whose Public folder is mounted.)

Note

If you frequently access multiple iDisks or iDisk Public folders, I’ll show you how to make connecting more convenient later in this chapter, under “Connecting to Frequently Accessed Servers and Shares.”

Connecting to iDisks as the Owner (or Using the Owner’s Member Name)

Although you can connect to the iDisk corresponding to the settings in the .Mac tab of .Mac preferences—presumably your own iDisk—using one of the methods explained previously, there may be times when you need to connect to a different iDisk as the “owner.” For example, you may personally have more than one iDisk, or perhaps another user gives you their own member name and password so that you have full access to their iDisk. (When you connect as the owner you have full access, meaning you can copy files to and from the iDisk and edit files on it.)

Just like connecting to an iDisk Public folder, there are three ways to connect to an iDisk as the owner. The first method is to use the Finder’s Go Ø iDisk Ø Other User’s iDisk… command. You’ll be presented with a Connect To iDisk dialog (Figure 11.2); enter the .Mac member name and password, and click Connect to mount the iDisk. The second approach is to use iDisk Utility’s Open iDisk screen; type the member name and password, and then click Open.

Figure 11.2: The Connect To iD- isk dialog

Finally, you can also use Connect To Server. Open the Connect To Server dialog, type http://idisk.mac.com/membername in the Server Address field (where membername is the user’s .Mac member name), and then click Connect. When prompted, provide the appropriate .Mac member name and password.

Tip

If you have multiple iDisks, or frequently access multiple iDisks as the “owner,” the free iDiskMenu (http://www.curvuspro.ch/developer/) is a very helpful utility. After supplying the membername and password for each iDisk, iDiskMenu provides quick access to those iDisks from a menu bar menu. Selecting one from the menu immediately mounts it in the Finder.

Start Sidebar
Keeping a “Local” Copy of an iDisk

If you open the iDisk tab of .Mac preferences, you’ll see an option called “Create a local copy of your iDisk.” This option, added in Mac OS X 10.3, creates a “clone” of your iDisk on your own computer. Instead of mounting your iDisk manually whenever you want to use it, which requires that you have Internet access, you can use this local copy at any time, regardless of your connection status—it’s always there, “mounted,” ready for you to copy files to and from it, edit files on it, etc. When you do have an Internet connection, Mac OS X can synchronize the contents of your local copy with your actual iDisk, located on Apple’s iDisk servers. (Note that you’re restricted to using this feature with only a single iDisk—the one designated in the .Mac tab of .Mac preferences.)

How this synchronization occurs depends on what you choose for the related Synchronize setting in .Mac preferences: Automatically or Manually. If you choose Manually, your local iDisk copy won’t be synchronized unless you specifically tell OS X to do so. You can initiate a manual sync in one of two ways. If you’ve chosen to have your iDisk shown in Finder sidebars, you’ll see that a “sync” button appears next to the iDisk; click it to sync your local copy with your real iDisk. Alternatively, you can control/right-click your iDisk’s icon anywhere in the Finder (or select it in a Finder window and click the Action menu toolbar item) and select Sync Now from the resulting contextual menu. (You can also switch between manual and automatic syncing from this menu.)

If you choose Automatically, OS X attempts to sync your local iDisk with Apple’s servers at periodic intervals; if you’re not connected to the Internet at that time, it waits until the next scheduled time that you’re connected. The downside to this is that if you make a change to your local iDisk copy, the change may not be reflected in your real iDisk until hours, or even days, later, depending on your Internet connection. (However, you can initiate a manual sync, using the procedure noted above, even if you’ve selected Automatically for your sync method.)

Regardless of how you sync your local copy, if you select your iDisk in any Finder window, the window’s status bar will show you when it was last synchronized (as well as how much space is left on it).

Local Copy Logistics

Here are a few things to keep in mind about the “local copy” iDisk option. First, when you initially enable the local copy option, you’ll notice that the initial synchronization can take a while—if you have a lot of stuff on your iDisk, a long while. However, subsequent syncs, although slow, won’t take nearly as long.

Second, because you’re creating a local copy of your iDisk, you can’t “unmount” it as you can other removable volumes.

Third, be aware that the “local copy” of your iDisk doesn’t actually include copies of every file on your iDisk. Specifically, files Apple has made available via your iDisk (via the Software folder) are not a part of your local copy, nor are the Library and Backup folders. The local copy mirrors only files you’ve placed on your iDisk, either by manually dragging them to it or by using one of the .Mac tools (Home Page, iPhoto albums, etc.) to place content on it.

Finally, if you ever change your mind about having a local copy of your iDisk, you can disable it by simply unchecking the “Create a local copy of your iDisk” option in .Mac preferences. When you switch to another preference pane/tab, or exit System Preferences, you’ll be asked if you’re sure you want to turn this feature off. Clicking the “Turn off local iDisk” button disables the feature; however, instead of deleting your local copy completely, OS X creates a disk image of it called Previous local iDisk for membername.dmg and places it on your Desktop. This is done as a precaution, in case there are files in your local copy that weren’t yet synchronized with your real iDisk. Be sure to check that there’s nothing on the disk image that you need to save before you throw the image away.

Should I Use the Local Copy Option?

The “local copy” option seems like such a great option that you may be wondering why anyone wouldn’t use it. Well, although Apple doesn’t come right out and say this, it’s not a great option for everyone. For one thing, the performance of local/real iDisk synchronization can be quite slow. For another, the more people who use this option, the slower Apple’s iDisk servers are for everyone—it uses a lot of network and processor overhead to constantly sync hundreds of thousands of iDisks with their “local” copies. In reality, if you mainly access your iDisk from a single computer, and you have a full-time Internet connection (DSL, cable modem, office network, etc.), you’re probably better off not using the local copy feature.

So who should use the local copy option? There are three groups of people who can really benefit. Laptop users (who often use their computers “in between” network connections) and users with slow and/or part-time Internet connections will both find the local copy option useful because it lets them access files on their iDisks even when they aren’t connected to the Internet. The other group that will appreciate this option is people who regularly access the same iDisk from more than one computer. Instead of always having to worry about whether or not they’ve uploaded the latest version of a file to their iDisk, they can rely on OS X to automatically sync files for them. (Although to be fair, if you find yourself in this position, you’ll want to manually sync before “leaving” a computer, just to make sure any changes you’ve made to your local iDisk are propagated to the real one. If you don’t, and OS X finds different changes to the same file on multiple Macs, you’ll be asked by OS X which one you want to keep—or if you want to keep both—the next time one of your computers attempts to sync.)

Accessing Your “Real” iDisk When the Local Copy Option Is Enabled

When you have the local copy option enabled, you’re not supposed to be able to access your actual iDisk directly—you’re supposed to make changes to the local copy and then allow OS X to sync those changes. In fact, if you use the Finder’s Go Ø My iDisk command, Mac OS X will simply open a new window showing your local copy. However, if for some reason you ever need to access the actual iDisk, you have two options. The first is to disable the local copy option; this will allow you to mount your iDisk (the real one located on Apple’s iDisk servers) normally. However, a simpler way is to access the local copy, select one of the aliases inside (Backup, Library, or Software), and then use the Finder’s Show Original command (choose File Ø Show Original or press command+R). This will show your “real” iDisk in the current Finder window; it will be named as your .Mac member name (your local copy will still be named iDisk).

End Sidebar

Connecting to Personal File Sharing

There are two ways to connect to a Mac OS X computer that’s sharing files using Personal File Sharing: via Network browsing and via Connect To Server.

Connecting Using the Network Browser

If the other Mac is running OS X 10.2 or later, and is on a local network with your Mac (specifically, the same subnet of the local network), you can take advantage of Rendezvous to browse the local network to find it. Open Connect To Server and click the Browse button; this opens a new Finder window in the Network view. (Alternatively, you can open a Finder window in Network view by choosing Go Ø Network or by clicking the Network item in the toolbar or sidebar of any Finder window. These methods will take you to the same place as Connect To Server’s Browse button.) The Network view shows you any local “servers” (Macs with Personal File Sharing enabled, or Macs or Windows computers with SMB sharing enabled), as illustrated in Figure 11.3. Double-click a server in list or icon view, or select it in column view and then click the Connect… button, to initiate a connection. (The Servers icon actually lists your own computer; you can ignore it.)

Click To expand
Figure 11.3: The Network view shows local servers.
Tip

In order to browse AppleShare servers—computers sharing files via File Sharing over AppleTalk that don’t support Rendezvous—in the Network view, your computer needs to have AppleTalk enabled both in the Directory Access application and for the network port configuration used to connect to the network. In OS X 10.3.0 through 10.3.2, Apple- Talk is disabled in Directory Access by default; if you’re running one of these versions of OS X, you’ll need to launch Directory Access and enable AppleTalk manually.

Once the connection is initiated, you’ll be asked for your username and password—remember that these will be your username and password on the Mac to which you’re connecting, not on your own computer. Assuming you provide the correct info, a dialog listing available share points on the server (the other Mac). (Remember from Chapter 10 that share points are directories or volumes that have been shared by another computer.) Select one (or more, by command-clicking each), and then click OK to mount the remote share(s) on your computer. (The password dialog will also include a Guest button; if the other Mac has Guest Access enabled, clicking this button will connect you to that computer as a guest user.)

Connecting Using Connect To Server

The second way to connect—necessary if the other Mac isn’t on the same local network or doesn’t support Rendezvous—is to open Connect To Server and enter the IP address of the remote computer. You’ll generally need to use this method when accessing Personal File Sharing over the Internet, but it can be used for local access, as well. Enter the target computer’s IP address (or domain name, if applicable) in the format afp://serveraddress, and then click Connect.

Tip

If a locally networked Mac that should appear in the Finder’s Network view doesn’t, or if you’d just rather use Connect To Server, type afp://rendezvousname.local in the Server Address field of Connect To Server, where rendezvousname is the other computer’s Rendezvous name, as shown in the other computer’s Sharing preferences.

Start Sidebar
Accessing Personal File Sharing: Normal versus Admin Users

Regardless of which method you use to connect to a server sharing files via Personal File Sharing—the Network browser or Connect To Server—if you’re a non-admin user on the Mac to which you’re connecting, the list of available shares will include your own home directory, the Public folders of other users, and any custom share points, if applicable, to which you have access.

However, if you’re an admin user on the remote Mac, the list will include either (a) the same options; or (b) your own home directory and any volumes connected to the other Mac. Which is the case depends on how the other Mac has been set up; for more info, check out “What Does It Share?” under “Sharing Remotely: Personal File Sharing” in Chapter 10.

Note that if you’re an admin user connecting to a Mac set up in the latter manner, you won’t see any custom share points since you already have the ability to view the volumes that contain the share points. If you have an admin account on a computer and need to verify that a custom share point is functioning properly—for example, after setting one up as described in Chapter 10—you can connect as any nonadmin user (such as one that can view the appropriate share points) by using their username and your own admin password. (As I mentioned in the previous chapter, the downside to this functionality is that it allows any admin user to gain access to non-admin users’ files.)

End Sidebar

Once the connection is successfully initiated, you’ll be asked for your username and password— remember that these will be your username and password on the Mac to which you’re connecting, not on your own computer.

Assuming you provide the correct info, you’ll be presented with a list of available share points on the server (the other Mac) (Figure 11.4). Select one (or more, by command-clicking each), and then click OK to mount the remote share(s) on your computer.

Figure 11.4: Connecting to Personal File Sharing shares
Note

If you’re connecting over the Internet to an OS 9 Mac running File Sharing, that Mac must have “Enable File Sharing clients to connect over TCP/IP” checked in the File Sharing control panel.

File Sharing Login Options

When you connect to another Mac using Personal File Sharing, you have a few options when it comes to logging in. In the name/password dialog, click Options… to get a list of connection preferences. The first, “Add Password to Keychain,” creates a new Keychain entry for that server (see Chapter 13 for more information about the Keychain in OS X). The next time you connect to that particular server, the password field will automatically be filled in for you. The second option lets you choose to send your password in “clear text.” If this option is enabled, your password will not be encrypted or otherwise protected, so anyone who might be able to intercept communication between your Mac and the target Mac will be able to figure out your password. Because this is an obvious safety risk, I recommend keeping this option disabled. (In fact, because this option is unsafe, the third option tells your Mac to warn you whenever you send a password in clear text.)

If the computer to which you’re connecting has Remote Login—which I’ll talk about later in this chapter—enabled in Sharing preferences, your computer can communicate with the other computer using the secure shell (SSH) protocol; all communication over that SSH connection will be encrypted. By checking “Allow Secure Connections using SSH,” you can tunnel your File Sharing connection over this encrypted connection. If the target computer has Remote Login enabled, I highly recommend enabling this option.

Start Sidebar
Network Browsing versus Connect To Server: OS X 10.3.0 - 10.3.2

In the main text, I discussed connecting to Personal File Sharing via Network browsing and the Connect To Server dialog. If you’re running OS X 10.3.3 or later, apart from the initial step—browsing to find a server in Network view versus manually providing the address of a server in Connect To Server—they function virtually identically.

However, if you’re running OS X 10.3.0 through 10.3.2, there are significant differences between these two connection methods in terms of how mounted shares behave. To put it bluntly, Network browsing stinks in these versions of OS X. Shares mounted via Network browsing don’t appear to “mount” like other shares—they don’t show up on the Desktop, in Finder sidebars, etc. You can’t take advantage of the standard login options (saving passwords to the Keychain, etc.) when mounting volumes via Network. When you access a server, you don’t get to choose which shares are mounted—OS X appears to “mount” all accessible shares, even if you don’t need/want to access all of them. From a technical standpoint, shares accessed via the Network browser are mounted at a different place in the filesystem from all other connected/mounted volumes. Finally, it’s difficult—sometimes it even seems impossible—to unmount these shares.

Luckily, Apple fixed all of these issues with the release of OS X 10.3.3. If you’re running OS X 10.3 and haven’t yet updated, I highly recommend doing so. If for some reason you can’t—perhaps some important application doesn’t work with 10.3.3 or higher—then I recommend avoiding the Network browsing and instead using Connect To Server.

For more information about the Network view and Connect To Server, check out Apple’s Knowledge Base article on the topic at http://docs.info.apple.com/article.html?artnum=107804.

End Sidebar

Connecting to Windows Shares

With Mac OS X, the Mac is finally a functioning member of Windows networks right out of the box. As explained in the previous chapter, SMB/CIFS is the standard sharing protocol on computers running Microsoft Windows, and OS X includes significant SMB support, allowing you to connect to Windows shares as easily as you connect to Personal File Sharing on other Macs. In addition, using SMB you can even connect to a Mac that has Windows File Sharing enabled, just as if it was a Windows computer.

To connect to a Windows share, you have the same two options as you do for Personal File Sharing (AFP): the Network browser (for local Windows servers) and Connect To Server (for both local and remote Windows servers). In fact, if you connect to a local Windows server via Network browsing, the process is almost identical; once you provide your username and password you’ll be presented with a list of shares available to that username.

Tip

In order to browse local SMB/Windows servers in the Network view, your computer needs to have SMB enabled in the Directory Access application.

Note

One limitation of Mac OS X’s Network browser is that it will show only computers on the same subnet as your computer. This isn’t a problem for most small office or home users, but if your Mac is on a large network that has been split into multiple subnets by your network administrator, you won’t be able to see Windows computers in other subnets. To connect to one of these Windows computers, you’ll need to use the procedure for connecting to remote computers.

Note

In OS X 10.3.3 and later, you can browse local Windows workgroups in the Network browser. However, in some older versions of OS X, this isn’t possible; in order to browse Windows shares, your computer needs to be in the same workgroup as the shares. (I discussed how to change your Mac’s workgroup in Chapter 10.)

To connect to a remote Windows share, open Connect To Server and type smb://serveraddress/ in the Server Address field, where serveraddress is the IP address or domain name of the Windows computer.

Many Windows servers will allow you to choose which share you want to mount before you’re asked to provide a name and password (Figure 11.5); after making a selection, you’re then asked for the appropriate name/password. (If you don’t see a share that you should, click the Authenticate button. After providing your name and password, the SMB Mount window shown in Figure 11.5 will appear again; sometimes logging in first will provide you with more choices from the pop-up menu of shares.)

Figure 11.5: The SMB Mount dialog lets you choose to which Windows (SMB) shares you want to connect.

However, for security reasons, some Windows computers require you to provide the specific share you’re trying to access, up front. In this case, open Connect To Server and type smb://serveraddress/sharename/ in the Server Address field, where sharename is the name of the share (a drive, volume, or directory that has been shared by the computer’s owner/administrator). If the share name contains spaces, type %20 in place of each space.

Click Connect to initiate the connection. (If you have trouble connecting to a Windows share using a domain name, see if using the actual IP address works; I’ve found that IP addresses seem to work better when connecting via SMB URLs.) You’ll then be asked to provide the workgroup in which the remote computer resides, your username, and your password. After entering the correct values and clicking OK, the Windows share will be mounted. Note that you can also include the work- group name in the original URL by typing smb://workgroup;serveraddress/share/.

Once the Windows share is mounted, you can work with it as you would any other mounted volume (within the privileges you have for the share, of course.) However, you should be aware that Mac OS X allows you to use certain characters in the names of files that the Windows OS does not; specifically, these characters are ? [ ] / \ = + < > ; : " , | *. (That final period is the end of the sentence, not one of the "forbidden" characters.) If you try to copy a file from your Mac to a Windows share and the filename contains one of these characters, you’ll get the error message "Error code = -43." You’ll need to edit the name of the file and try the copy again.

Limitations to Mac OS X’s Windows Share Access

Although OS X includes significant support for accessing Windows shares, at the time of this writing it does have a few limitations in addition to the ones mentioned above:

  • OS X supports SMB over TCP/IP, but not over NetBEUI; thankfully, most newer versions of the Windows OS share files over TCP/IP.

  • Administrative shares (those that end with a $ character) aren’t accessible from a Mac without using a utility such as DAVE (discussed below).

  • At the time of this writing, you can connect to only a single SMB volume at one time. If you need to mount a different Windows share, be sure to drag the first to the Trash to unmount it first, then connect to the second. Mounting more than one SMB volume simultaneously can cause a kernel panic.

  • Some users experience problems—such as system freezes—if they put their Mac to sleep or disconnect from their Internet or network connection with a Windows share mounted. This problem seems to occur much less frequently in Mac OS X 10.3 and later, but if you experience this problem, you should be sure to unmount Windows shares before disconnecting or putting your Mac to sleep.

Alternatives to Mac OS X’s Windows Access: DAVE

Although it’s great that Mac OS X provides the ability to connect to Windows shares right out of the box, this ability is somewhat limited in its functionality. For example, I already mentioned that OS X can only browse workgroups that are located in the same subnet as your computer. Another commonly encountered shortcoming is that OS X doesn’t support Windows Shortcuts (they show up as generic files and don’t link to their targets). If you only occasionally connect to Windows shares, you’ll probably be perfectly happy with OS X’s connection capabilities. However, if connecting to Windows shares is something you do frequently, or if your Mac sits on a large Windows network, you may want more functionality than OS X provides.

Thursby Software’s DAVE (http://www.thursby.com/) is far and away the most comprehensive utility for interacting with Windows computers and networks from your Mac. I mentioned it in the last chapter as a way to extend your Mac’s ability to share files with Windows computers, but it’s a powerful tool for connecting to Windows computers, as well. Some of the advantages that DAVE provides over Mac OS X’s built-in functionality include the ability to authenticate with a Windows network at login in order to mount shares on the network without entering your name and password, the ability to mount multiple shares quickly, the ability to browse workgroups and Windows computers throughout a network (not just on the local subnet), support for Windows Shortcuts, and the ability to change your Windows network password from your Mac. Another nice bonus is that by putting the DAVE installation CD in a Windows computer, you can quickly verify that it’s properly set up to share files over a network. If you’re having connection problems, this is a great feature that can help you isolate the cause (either with your Mac or with the Windows computer).

DAVE is a bit more expensive than much of the software mentioned in this book; however, if your Mac sits on a Windows network, DAVE is well worth the investment. Instead of just providing a way to interact minimally with Windows computers, it makes your Mac a full citizen on Windows networks.

Connecting to FTP/SFTP Servers

A decade ago, FTP was the dominant way to share and access files over the Internet. Shareware and free- ware, documents, software updates—all of these were commonly distributed using FTP servers. Nowadays FTP has been relegated to second-class citizenship, for a few reasons. The first is that other, more convenient, methods have been developed; whereas FTP generally required you to transfer files using a command-line prompt, or at best a dedicated FTP client, other methods (including a few discussed in this chapter) allow you to mount remote folders and volumes in the Finder and use them just like local volumes. Second, the increasing influence of the World Wide Web means that distributing files via Web servers is much more reliable than using FTP servers—everyone has a Web browser. Finally, as I discussed in the previous chapter, FTP itself isn’t a secure protocol, so using FTP for anything other than anonymous (guest) access is a security risk.

Nevertheless, because FTP servers are simple to set up and provide excellent data transfer speeds, they’re still a popular way to share files, especially files that don’t require security, over the Internet. Developers often use them to provide evaluation versions of software or software updates, and end users use them to exchange files. In addition, much website management (the editing and uploading of Web pages) is still done via FTP. What’s more, SFTP—the secure implementation of FTP that uses secure shell (SSH) access to encrypt all data—is becoming more and more popular as a substitute for FTP; since it’s cross-platform, SFTP is a secure way to share files both within and between platforms. Here are a few of the ways you can connect to FTP and SFTP servers.

Warning

Because of the security issues inherent to FTP connections, I recommend connecting using FTP only to servers that allow anonymous (guest) connections, and only for transferring non-sensitive data and files. If you need to send sensitive information and/or you want to make sure no one can steal your username and password, try to use SFTP instead.

Note

As I mentioned in the previous chapter, FTP and SFTP are actually command-line applications; FTP and SFTP clients that feature graphical interfaces are actually issuing the appropriate commands to the FTP/SFTP server for you, “under the hood.” If you like doing things the hard way, you can open Terminal and do everything manually. Use the man ftp or man sftp command in Terminal to get the complete manual for each application.

FTP via Your Web Browser

Because FTP is such a common method for distributing software, most Web browsers include a limited degree of FTP support. I don’t recommend using a Web browser for interactive FTP use, but if you have the complete URL to a file that resides on an FTP server (e.g., ftp://server/directory/filename), and that FTP server allows guest access, the easiest thing to do is often to simply type or copy/paste the URL into your Web browser; the file will be downloaded to your computer. Unfortunately, none of the Web browsers available at the time of this writing support SFTP.

FTP/SFTP Using a Dedicated FTP/SFTP Client

If you actually need to interact with an FTP or SFTP server (upload files, rename files, etc.), the best way is to use a dedicated FTP/SFTP client. These applications provide you with the full range of FTP/SFTP functionality; under OS X, most also have excellent user interfaces that make working with servers easy and convenient. The most popular FTP/SFTP clients for OS X are:

  • Interarchy (http://www.interarchy.com/), commercial/shareware

  • Transmit (http://www.panic.com/transmit/), commercial/shareware

  • RBrowser (http://www.rbrowser.com/), commercial/shareware

  • Fetch (http://www.fetchsoftworks.com/), commercial/shareware (Note that at the time of this writing, Fetch is currently FTP-only; however an SFTP version is in the works.)

  • Vicomsoft FTP Client for Mac OS X (http://www.ftpclient.com/), commercial/shareware

  • Captain FTP (http://captainftp.xdsnet.de/), commercial/shareware

  • FTPeel (http://freshlysqueezedsoftware.com/products/ftpeel/), commercial/shareware

  • Fugu (http://rsug.itd.umich.edu/software/fugu/), freeware

  • Cyberduck (http://icu.unizh.ch/~dkocher/cyberduck/), freeware

Interarchy provides an extensive feature set unmatched by any other FTP/SFTP client, and over the years it has become the “power user” client of choice. However, Transmit provides an excellent set of features (including some unique ones such as file previews and a built-in text editor) along with a stellar interface. For the latter reason, I’m going to use Transmit in the examples below. Keep in mind, however, that all FTP/SFTP clients operate similarly in terms of connecting and interacting.

To connect to an FTP or SFTP server, most clients present you with a connection dialog that asks for the server address, username, password, and other information (Figure 11.6). In the case of Transmit, you’re also asked which protocol to use, FTP or SFTP. (Some clients instead provide different connection dialogs for FTP and SFTP.) In the Server field, enter the server’s IP address or domain name (don’t include ftp://—the client will do that for you when you connect). If you’re connecting anonymously, enter anonymous in the User Name field and leave the Password field blank (or enter your e–mail address; some anonymous servers require this). If you’re connecting via SFTP (or to an FTP server that requires an account), enter your actual username and password.

Click To expand
Figure 11.6: Using Transmit to connect to another computer via SFTP
Tip

If your FTP/SFTP client supports Rendezvous (Transmit does, for example), instead of entering the FTP server’s IP address, you can select local, Rendezvous-enabled FTP/SFTP servers from the client’s Rendezvous menu.

If you know the specific path to which you want to connect on the target computer, you can enter it in the Initial Path field (you’ll also see this field as Directory in some clients). Finally, most FTP/ SFTP clients give you the option of specifying a nonstandard port if the target computer isn’t using standard FTP (20 and 21) or SFTP (22) ports.

Once you’ve entered the required information, click Connect (or OK in some clients), and the application will connect to the FTP/SFTP server. However, instead of the share/server mounting in the Finder as it does with Personal File Sharing or SMB access, all interactions with the server will take place from within the FTP/SFTP client. Depending on which client you’re using, what you see can look like a Finder window (Interarchy takes this approach), a file browser, or, in an application such as Transmit, a dual-paned window that shows you the contents of a directory on the server and the contents of a directory on your own computer side-by-side (Figure 11.7); I find the latter to be convenient for moving files between my own computer and an FTP/SFTP server.

Click To expand
Figure 11.7: Transmit shows you “your stuff” and “their stuff” when connecting to an FTP or SFTP server.

You can generally navigate within those directories to which your account has access. You can also upload, download, rename, and delete files as needed (again, provided you have the appropriate privileges). Most Mac OS X FTP/SFTP clients provide excellent ease of use: double-clicking a file in a server window, or dragging it to your Desktop or a Finder folder, downloads it; dragging a file from the Finder to a server window uploads it. (In the dual-pane method used by Transmit, you can simply drag files between panes.) Most clients also have extensive additional options for working with files, accessible through the client’s menus. For example, Interarchy and Transmit allow you to synchronize remote and local folders—if you manage a remote website, this is a great way to automatically upload any Web pages or files you’ve recently edited or added.

A Promising Prospect: FTP in the Finder

As I mentioned above, one drawback of FTP has always been that you’re forced to use either the command line or a dedicated FTP client to access shared files. However, starting with OS X 10.2, Apple integrated some degree of FTP browsing into the OS X Finder. To get a glimpse of how FTP in the Finder works, go to Connect To Server and enter an FTP server’s address in the form ftp://serveraddress/. You can even include a directory and/or a username and password in the format ftp://username:password@serveraddress/directory/. Click Connect, and the FTP server will actually be mounted in the Finder just like a Windows SMB share or Personal File Sharing share point.

Unfortunately, at the time of this writing, the implementation of FTP in the Finder isn’t flawless. For example, SFTP isn’t supported, you can’t upload or edit files (you have only read-only access), and sometimes the Finder crashes. However, it looks like a promising avenue. I hope that by the time you read this, or soon after, this new approach will be improved to the point that you rarely need a dedicated FTP/SFTP client.


Connecting to NFS Servers/Shares

In addition to Windows and Mac shares, OS X can also connect to Unix Network File System (NFS) exports. NFS exports are a common way to share directories that reside on Unix computers over the Internet. Although most home users will never encounter an NFS export, they’re common in university and research settings.

To access an NFS share, open Connect To Server and enter the URL of the share in the format nfs://serveraddress/exportpath, where exportpath is the path to the particular Unix directory you want to access. You’ll be asked for your username and password, after which the export will be mounted in the Finder much like any other remote share.

Tip

To automatically mount NFS shares, check out NFS Manager, which I mentioned in Chapter 10.


Connecting to Frequently Accessed Servers and Shares

Although connecting to a particular server may often be a one-time deal, there’s a good chance that if you’re accessing files from a remote computer, you’ll be doing so more than once. In the following sections I’ll show you how to take advantage of functionality I’ve discussed previously to make repeated connections more convenient.

Using Aliases (iDisk/AFP/SMB/NFS)

I talked about aliases in Chapter 5 as a way to quickly access files and folders, but they’re also extremely useful as a way to quickly access iDisks as well as Personal File Sharing, Windows SMB, and Unix NFS shares. Once a share is mounted on your computer (under Computer in a Finder window, and/or on the Desktop if you’ve chosen to show mounted volumes on the Desktop via Finder preferences, and/or Finder window sidebars, if you’ve enabled that option), make an alias of the share itself. You can store this alias anywhere on your hard drive; the next time you want to connect to the share, simply open the alias. You’ll be presented with the familiar name/password dialog; enter the appropriate information and the share will be mounted, without having to use the Connect To Server dialog.

If you tend to access the same sub-folder on a remote share, you can actually make an alias to that folder or directory itself, rather than to the enclosing share. Double-clicking such an alias will mount the share in the same way, but the sub-folder will automatically be opened for you.

To make things even more convenient, for many servers you can avoid having to enter your name and password by saving your login information in your Keychain, as I mentioned earlier in the chapter under “File Sharing Login Options.” If you use this option before you make an alias to a share, your login info will be automatically entered the next time you double-click the alias to the share. (I’ll talk more about the Keychain in Chapter 13.)

Tip

You can make aliases to all of your frequently accessed shares and servers and then take advantage of one of the methods for quick file access described in Chapter 5. For example, put all of these aliases in a single folder and then drag that folder to the Dock. You’ll have instant access to any of your remote shares by control/right-clicking the folder in the Dock. You can also drag shares (or sub-directories of shares) directly to Finder window toolbars; the new toolbar item will remain even after you unmount it. This saves you the trouble of creating an alias, and a quick click on the toolbar item will mount the share (and, in the case of a subdirectory, open that directory).

Using Internet Location Files (i.e., Location Files, Part II)

I’ve mentioned Internet Location files in several places throughout the book. They’re OS X’s way of creating bookmarks for particular URLs. Double-clicking an Internet Location file opens the enclosed URL appropriately; for example, HTTP Location files open in your default Web browser. What you may not be aware of is that, like URLs themselves, Internet Location files support many different protocols: an AFP Location file will attempt to mount a Personal File Sharing share point, and an FTP Location file will attempt to connect to an FTP server. If you could create your own Internet Location files, you’d have a great tool for quickly accessing remote computers, right?

Fortunately, Internet Location files are extremely easy to create, but the way to do so isn’t completely obvious.

  1. Open a text editor such as TextEdit or BBEdit.

  2. Type in the complete URL of the server/share you want to access; I’ve included examples of the most common types below (in “Location File Formats”).

  3. Highlight the complete URL.

  4. Drag the highlighted URL to the Finder (e.g., the Desktop or any other folder).

An Internet Location file will be created (Figure 11.8). You can double-click the file to access the share or server just as if you had opened Connect To Server and typed the URL in manually. In fact, most URLs can also contain a username and password, saving you the trouble of having to enter them each time you connect. You can rename Location files as you please; it won’t affect their ability to connect.

Figure 11.8: Internet Location files for (left to right) a remote Personal File Sharing server, a local Mac running Personal File Sharing, and an FTP server

The only downside to Internet Location files is that you can’t edit them directly. If you need to change the address or any other information contained in an Internet Location file’s URL, you’ll have to throw away the original and create a new one. Before you throw it away, however, drag it into an open text document, which will paste the URL into the document; you can then edit the URL as needed, highlight it, and then drag it to the Finder to create a new Location file.

Once you’ve created Internet Location files, you can put them in the Dock, in a folder in the Dock, in a menu, or any other place where you have quick access to them.

Location File Formats

Table 11.1 shows the formats for URLs supported by Internet Location files; Table 11.2 indicates how to include username and password info in the Location file. If you can put up with slightly less convenience (having to enter the password manually), for security reasons I generally recommend not including the password. (That being said, for SMB and SFTP Location files to function, you actually need to include the password.)

Warning

If you include your username and password in Location files, be sure to store these files somewhere secure—inside the private areas of your user folder—so that other users don’t have access to them!

Table 11.1: Common Location File (URL) Formats
Type of Connection | URL Format for Internet Location Files
iDisk | http://idisk.mac.com/membername
iDisk Public Folder | http://idisk.mac.com/membername/Public
Personal File Sharing/AppleShare | afp://serveraddress/
Specific Volumes or Share Points via Personal File Sharing | afp://serveraddress/volume or share name (Use %20 in place of spaces in volume or share point names.)
Personal File Sharing via Rendezvous | afp://rendezvousname.local (Add /volume or /sharename to the end to connect to specific volumes or share points.)
FTP | ftp://serveraddress
FTP (anonymous access) | ftp://anonymous@serveraddress
NFS exports | nfs://serveraddress/exportpath
Table 11.2: Location File Formats, Including Passwords
Type of Connection | URLs Modified with Passwords
iDisk | http://membername:password@idisk.mac.com/membername
iDisk Public Folder | http://public:password@idisk.mac.com/membername/Public
Personal File Sharing/AppleShare (AFP) | afp://username:password@serveraddress/
Specific Volumes or Share Points via Personal File Sharing (AFP) | afp://username:password@serveraddress/volume or share name
Personal File Sharing via Rendezvous (AFP) | afp://username:password@rendezvousname.local
FTP | ftp://username:password@serveraddress
NFS exports | nfs://username:password@serveraddress/exportpath
Windows Files Sharing (SMB) | smb://workgroup;username:password@serveraddress/share
Secure FTP (SFTP) (see note below) | sftp://username:password@serveraddress
Tip

Unfortunately, at the time of this writing, OS X doesn’t seem to have a built-in file mapping setting for SFTP, so you’ll need to add one in order for SFTP Location files to work properly. I recommend using More Internet, as discussed in Chapter 9. In the More Internet preference pane, click Add… In the resulting dialog, type sftp as the protocol, type Secure FTP for a description, and then click Add. Select the new “sftp” item in the list of protocols, and then drag your favorite SFTP client into the main More Internet window to associate the client with the SFTP protocol. From now on, opening an SFTP Location file will connect to that SFTP server using the chosen client. Similarly, the default “helper” for FTP at the time of this writing is the Finder. If you’d rather use a dedicated FTP client, you’ll need to edit the FTP helper setting using a similar procedure.

SMB Location Files and Mac OS X 10.2

Unfortunately, if you’re using OS X 10.2, SMB (Windows File Sharing) Location files don’t seem to work. As an alternative, you can create an AppleScript that will mount SMB shares. Open the Script Editor application, and in the main (top) text field type:

tell application "Finder"
 mount volume "smb://workgroup;username:password@serveraddress/share"
end tell

(Those are three separate lines.) Save the new script someplace convenient, choosing a File Format of Application in the Save dialog. You can then double-click that script to connect to the SMB share.

Using Location Files with Dock and Custom Menus

In Chapter 5 and the Online Supplement, I talked about adding custom menus to OS X as a way of quickly accessing files and folders. In Chapter 6, I also covered the Dock as a way to access these items. If you have several remote servers or shares that you access frequently, Dock menus and custom menus can be extremely convenient. For example, you can place all of your Internet Location files in a folder and drag that folder to the Dock, and you have an instant Dock menu that provides one-click access to any server (Figure 11.9). Likewise, if you use one of the many third-party menu utilities available for OS X—I mentioned a number of these in Chapters 5 and 6—you can add your Location files to their menus for quick access. A menu utility I haven’t mentioned yet that’s especially useful in this capacity is the freeware iChoose (http://www.luckysoftware.dk/ichoose.php). You can simply drag Internet Location files into the iChoose preference pane to add them to your iChoose menu. In addition, iChoose lets you add URLs directly (in the formats listed above), without having to create Location files first.

Tip

You can also drag Location files to Finder toolbars and sidebars to provide quick access.

Figure 11.9: Accessing favorite servers via the Dock

Using Location Files as Recent Servers and Favorites

If you don’t want to clutter your Dock or use a third-party menu, you can use your Internet Location files with Mac OS X’s built-in Favorites and Recent Servers features to gain quick access to remote shares.

I mentioned earlier in this chapter that when you access a server via Connect To Server, OS X creates a Location file in ~/Library/Recent Servers, and when you add a server as a Favorite, a Location file is created in ~/Library/Favorites. These files are simply standard Internet Location files. What this means is that by placing Internet Location files that you’ve created into one of these two directories, those URLs will show up in the Connect To Server dialog (in the Recent Servers pop-up menu or the Favorite Servers box, respectively).

Warning

If you place an Internet Location file in ~/Library/Favorites or ~/Library/Recent Servers, it will show up in the Connect To Server dialog by the URL contained in it—including any username and password— rather than by the name of the Location file. This isn’t too bad when you’re using Location files within your own account, but be aware that if someone else has access to your Location files, they could use this trick to view your name and password.

Automatically Connect to Shares/Servers at Login

If you use a particular remote share or server on a regular basis, you may find yourself connecting to it each time you log in. Under Mac OS 9, when you connected to an AppleShare volume, you could choose to have the volume mounted at startup automatically. This option is gone in Mac OS X, but you can use OS X’s Login/Startup Items (described in Chapter 3) to gain similar functionality.

Although you can drag mounted servers themselves into the Login/Startup Items list, they will only be mounted automatically at Login if you’ve connected in a manner that lets you save your password for the server to the Keychain. Instead, I recommend using Internet Location files. Simply drag the Internet Location file for the server or share to which you want to connect into the Login/Startup Items list in System Preferences—preferably at the bottom of the list of items so that it’s opened last—and the next time you log in, the server or share will be mounted automatically.

Tip

Mac OS X also has the ability to use auto mount points, which are basically a way to automatically mount shares at startup rather than at login—meaning that these shares will be available to everyone rather than just an individual user. Unfortunately, Apple hasn’t provided an easy interface to create auto mount points. You can find a nice tutorial at http://www.bombich.com/mactips/automount.html. In addition, the author of SharePoints, which I’ve mentioned in several places in the book, has created a useful utility called SharePoints AutoMounter (http://www.hornware.com/sharepointsautomounter/) that lets you do this. If you need to automatically mount shares/servers at startup so that they’re available to all users, you should give SharePoints AutoMounter a try. (Note that auto mount points work only with AFP shares that have guest access enabled.)


Connecting to Virtual Private Networks (VPN)

To ensure the privacy of data sent over the Internet, many businesses and universities use a technology called Virtual Private Networking (VPN). A VPN lets a remote user communicate with another computer, or a company LAN, over a normal Internet connection; however, what’s unique about a VPN is that it creates a secure “tunnel” between the two. Data is encrypted at one end and then decrypted at the other end; data that isn’t encrypted using the same key (password) used at the creation of the VPN can’t enter the tunnel, and no one can access data in the tunnel, or at the other end, without the correct key.

Until recently, most VPN client software was Windows-only, effectively keeping Macs out of many corporate networks. However, beginning with OS X 10.2, your Mac has a VPN client builtin. In OS X 10.2, this VPN client supports Microsoft’s Point to Point Tunneling protocol (PPTP), meaning you can connect to many Windows networks that require VPN connections without any additional software. In OS X 10.3, Apple added support for Layer 2 Tunneling Protocol (L2TP) over the IP Security Protocol (IPSec), which means that your Mac supports even more Virtual Private Networks.

Note

Some Cisco VPN servers require a proprietary VPN client; if your network is using a Cisco VPN server, your network administrator should be able to provide you with the appropriate software.

Unfortunately, unless you know exactly where to look, you’ll probably never find OS X’s VPN support—Apple buried it in the menus of the Internet Connect application. If you need to open a VPN connection, launch Internet Connect and select File Ø New VPN Connection… If this is the first time you’ve tried to use OS X’s VPN client, you’ll get a message that “Your computer needs to be set up to make VPN connections.” Choose the type of VPN connection you’re going to be using (L2TP over IPSec, or PPTP), and then click Continue; OS X will set things up for you. (In fact, if you open the Network pane of System Preferences after this step, you’ll find that a new Network Port Configuration called PPTP or VPN (L2TP) has been created.)

The VPN Connection window (Figure 11.10) asks for the VPN server’s address (get this from your network administrator), as well as your network username and password. Click Connect to initiate the connection.

Tip

If you’re connecting to a Windows network, your username might actually be your network domain followed by your actual username, in the format domain\username—check with your network administrator to be sure.

Figure 11.10: Mac OS X’s VPN Connection dialog box

The VPN connection screen in Internet Connect works very much like the dial-up connection screens, which I discussed in Chapter 9. The status bar at the bottom of the window will tell you if your connection is successful and, if so, will display your IP address on the remote network, as well as a timer of how long your VPN connection has been active. (Once you’ve connected to the VPN, if you open Network preferences you’ll see that the IP address shown in the Status section of the VPN connection window will also be listed under the appropriate Network Port Configuration— PPTP or L2TP). If you connect to multiple Private Networks, you can use the Configuration popup menu to create, and switch between, multiple connection configurations for that type of VPN (PPTP or L2TP); this can save you from having to retype connection information each time. Finally, the “Show VPN status in menu bar” option allows you to add a VPN menu extra to the menu bar; you can use this menu to quickly connect using any VPN configuration and to see the status of that connection.

Once you’re connected to your company or organization’s network via VPN, your Mac will think it’s actually sitting on that network. You should be able to browse Mac and Windows shares in the Network browser and connect to shares just as you would if your Mac were on the local network.

Note

A number of third-party VPN Clients (and even VPN servers) that provide additional functionality are also available for Mac OS X. VPN Tracker (http://www.equinux.com/us/products/vpntracker/index.html) and VaporSec (http://www.afp548.com/Software/VaporSec/) are two popular examples.


Remote Access and Control

In addition to sharing files with other computers and accessing files on other computers, it’s also possible to remotely access and control a Mac running OS X (i.e., from another computer). Maybe you want to move a file from your private Documents folder to your Public folder so that another user has access to it, but you aren’t sitting at the computer at the time. Perhaps you want to make sure Software Update runs on another computer in your home or office without having to sit down at and log into that computer. Or maybe you’re trying to troubleshoot a problem on another computer, and seeing what the other user is seeing will help you better understand what’s going wrong. You can accomplish each of these tasks remotely using either OS X’s built-in abilities or third-party software.

Remote Login

The simplest type of remote “control” of a Mac—in terms of both the interface and the tools needed—is called Remote Login, and it’s built into every Mac running OS X. To enable Remote Login on a computer—which will allow you to access that Mac remotely—simply open the Sharing pane of System Preferences and check the box next to Remote Login in the Services tab. To the right you’ll see the message “Remote Login On.” What this actually does is enable OS X’s built-in secure shell (SSH) server. SSH allows a remote computer to connect via a command-line interface, authenticating and encrypting all communication between the server and the remote computer.

Note

If you’ve ever used a Telnet connection, an SSH connection will look very familiar; it’s basically a secure, encrypted alternative to Telnet.

Once Remote Login is enabled, any user with an account on your Mac can connect using a command-line application (such as OS X’s Terminal or Window’s Console) and then log in using their username and password. Once connected, the user can execute pretty much any command available to them when physically sitting at the computer, logged in, using Terminal. In the case of an admin user, this is an incredible amount of power, so be very careful who has admin access on your machine if Remote Login is enabled.

As a side note, despite the name, Remote Login doesn’t have to be remote—you can actually log in to your own computer from another user account on your computer. For example, if another user is currently logged in and you want to move a file from your Documents folder to a publicly viewable directory so that the user can access it, you can launch Terminal from within their account, but log in to your computer via SSH using your own username and password. You can then move the file (as described in the example a bit later in the chapter) and disconnect. This is a lot more convenient than having the other user log out, logging in to your own account via the login window, moving the file, logging out, and then having the other user log in again. (That being said, although this is a neat trick, using the su, or switch user, command—su yourusername<RETURN> and then entering your pass- word—does the same thing without requiring that Remote Login be enabled. Plus, if you’re using OS X 10.3 or later, Fast User Switching—discussed in Chapter 1—lets you actually switch to your own user account. Details, details.)

Tip

If you use SSH often, and especially if you connect to multiple computers, you should try JellyfiSSH (http://www.arenasoftware.com/grepsoft/) or SSH Helper (http://www.gideonsoftworks.com/). Both allow you to store settings for multiple SSH connections—including custom Terminal and keyboard settings—and quickly connect to them.

Connecting via Remote Login

User Level | any, unless restricted by an admin
Affects | user
Terminal | yes

To connect to a Mac using Remote Login, open Terminal on another Mac (or Console on a Windows computer, or any Unix command-line app), and type ssh username@serveraddress <RETURN>, where username is your short username (on the computer to which you’re connecting) and serveraddress is the IP address (or, if applicable, the domain name) of the target computer. (If you’re connecting from another Mac, and your short username is identical on both Macs, you can just type ssh serveraddress <RETURN>; OS X will automatically send your username for you.) After a few seconds you’ll be asked for your password; after providing it you’ll see a standard command-line interface, just as if you were using Terminal in person.

Note

To log in to the local computer (the one you’re actually using) to test that SSH is working properly, type ssh usernameI@localhost <RETURN>.

Once you’re connected to the remote computer, your command-line prompt will change to reflect that you’re no longer working locally; for example, in most shells, the name of the remote computer will be included in your Terminal prompt. At any point, type exit <RETURN>, and you’ll be logged out and disconnected (from the remote computer, not your own).

Internet Location Files and Remote Login

Earlier in the chapter I showed you how to create Internet Location files for frequently accessed servers and shares. You can actually create these Location files for SSH connections, as well. Use the same steps you’d use to create any other type of Internet Location files, but for the URL type ssh:// username@serveraddress. Opening the resulting Location file will launch Terminal and initiate an SSH connection with the server using the appropriate username. (You can’t include your password in an SSH location file since the remote computer won’t ask for your password until after a secure connection is established.)

Restricting Remote Login Access
User Level | admin
Affects | computer
Terminal | no

When Remote Login is enabled, any user with an account on your Mac can access it via an SSH connection. As I mentioned above, because of security concerns, you may want to restrict who has admin-level status on your Mac if Remote Login is enabled.

Another approach is to simply limit who can log in via SSH, regardless of their user level. Here’s how.

  1. If Remote Login is currently enabled, disable it in Sharing preferences.

  2. Open TextEdit (or another text editor) as root, as described in Chapter 1.

  3. In the text editor, choose File ØOpen…

  4. When the Open dialog appears, press shift+command+G. (This is equivalent to choosing “Go to Folder…” in the Finder.) Type /etc and click the Go or "Go to" button to go to the /etc directory.

  5. In the Open dialog, select the file called sshd_config (not the one called ssh_config) and click Open. This is the configuration file for SSH (Remote Login).

  6. Scroll to the very end of the configuration file and, on a new line, type AllowUsers username, where username is the name of a single user you want to be able to connect to your Mac via Remote Login/SSH. If you want to allow multiple users to connect via SSH, add their usernames to that line, separated by spaces. For example, on my computer I added AllowUsers frakes jennifer trouble.

  7. Save your changes.

  8. Enable Remote Login in Sharing preferences.

From now on, only users listed in the AllowUsers line will be able to connect via Remote Login.

Using Remote Login

As I stated earlier, once remotely logged in to a Mac, you can do anything that you could do if you were using Terminal while sitting at the computer. Because of the sheer number of commands and applications that can be run from Terminal, I can’t provide you with a comprehensive list of possible tasks. However, I talk a good deal more about Terminal commands in Chapter 15. In addition, Table 11.3 lists some of the most common commands.

Table 11.3: Common Commands Used via Remote Login
Command | Description
ls | List the files in the current directory.
pwd | List the path of the current directory (the working directory).
cd | Change directory (e.g., cd /Users/Shared to switch to the Shared user folder).
mkdir | Create (make) a new directory (e.g., mkdir 'New Files' to create a new directory named New Files).
rm | Remove/delete a file (e.g., rm 'Sample.doc').
rmdir | Remove/delete a directory (e.g., rmdir 'New Files').
mv | Move file (e.g., mv /Users/username/document /Users/Shared/document to move a file called document from inside your user folder to the Shared user folder).
cp | Copy file (e.g., cp document document2 to make a copy of document named document2).

These are just a few (very, very few) of the commands you can use when logged in remotely. To give you a better idea of the kinds of things you can do using Remote Login, here are a few short examples.

Moving a File from Your Documents Folder to Your Public Folder
User Level | any
Affects | user
Terminal | yes

Imagine that you have a document on your computer that you want another user to be able to access. However, that document is currently inside your Documents folder, and you’re not at home to move it someplace where the user can get to it (such as your Public folder). You can use Remote Login to move it or copy it to your Public folder.

  1. Log in to your Mac remotely by typing ssh username@serveraddress <RETURN> in any command-line application. Enter your password, and press return.

  2. Your initial working directory (the directory you’re “in” when you first log in) will be your user folder; type ls <RETURN> to view the names of all the folders in your home directory.

  3. Change to the directory that contains your file. Do this by typing cd foldername <RETURN>, where foldername is the name of the folder to which you want to switch. For example, switch to your Documents folder by typing cd Documents <RETURN>. ("Changing directories" in Unix is much like opening a folder in the Finder to work with files inside of it.) Type ls <RETURN> again to view the contents of the folder to which you just switched.

  4. Continue to use cd and ls until you find the document you want to move. (If you want to move up a level—say, from Documents to your main user folder—type cd .. <RETURN>. This is the Unix command for viewing the folder enclosing the current directory.

  5. Once you find your document, type mv documentname /Users/username/Public/ documentname <RETURN> (where documentname is the exact name of the document and username is your short username) to move it from the current directory to your Public folder. If you’d rather keep the original document where it is and place a copy of it in your Public folder instead, type cp documentname /Users/username/Public/documentname <RETURN>.

After following these steps, your fellow user(s) will be able to access the document in question by opening your Public folder (either while sitting at your computer or via one of the remote sharing options discussed in the previous chapter).

Tip

As I mentioned earlier, you can use this same procedure if you are near your computer, but you don’t want to make the other user log out, then log in yourself, move the file, log out, then have the other user log in again. Simply launch Terminal from within the other user’s account, type ssh yourusername@localhost <RETURN>, provide your password, and then move the file as described above. When you’re done, type exit <RETURN>. (Although as I mentioned above, you could also use the su command—su yourusername <RETURN>—or Fast User Switching.) The ability to login to your own account via Terminal from within another user’s account is a real time-saver and convenience that I use quite frequently.

Quitting an Application That’s Taken Over Your Mac
User Level | admin
Affects | user
Terminal | yes

Sometimes an application will “hang”—it will freeze and take up so much of the CPU that you can’t even use the Force Quit window to quit it. In situations like these, if you have another computer handy and have Remote Login enabled, you can sometimes quit the application remotely, giving you back your Mac.

  1. From another computer, log into your Mac using SSH.

  2. Type top -u <RETURN>. This will present you with a list of all running applications, sorted by CPU usage—chances are the problematic application will be listed first since it’s hogging the processor. Note the PID (process ID) number of that application on the left.

  3. Press the Q key to quit the top utility and return to the Terminal prompt.

  4. Type sudo kill -9 PID <RETURN>, where PID is the process ID number of the problematic application (which you got from the top display). Enter your password when prompted. This will unmercifully quit the application

  5. Log out, walk back to your computer, and enjoy not having to restart.

Although this process isn’t foolproof—some crashes are so severe they don’t even let you log in remotely—when it works, it’s a real time-saver.

Using Software Update Remotely
User Level | admin
Affects | computer
Terminal | yes

I talked about the Software Update application in Chapter 4. However, there’s also a command- line version of Software Update that’s accessible via Terminal—and, thus, when logged in remotely. Although this feature is priceless for a network administrator who is supporting many Macs, it can be quite useful even for the home user. For example, my home office has a desktop Mac, but our family also has a PowerBook on an AirPort network. Occasionally I’ll run Software Update on the desk- top Mac and find that a new update is available. In the past, this meant having to go find the PowerBook (wherever it might be in the house) and then running Software Update on it. But under OS X, I can simply launch Terminal on the desktop Mac, log in to the PowerBook remotely, and update the software right from my desk. (I’m not lazy; I’m just busy. Really.)

Here’s how you do it. (In this example, “target computer” is the computer you’re updating, and “remote computer” is the computer from which you’ll be accessing the target computer).

  1. Log in to the target computer remotely using SSH.

  2. Type sudo softwareupdate -l <RETURN> (that’s a lowercase L) and provide the password for your admin-level account when prompted. (If the target computer is running OS X 10.2, you don’t need to include the -l.) Software Update will run on the target computer, and you’ll be provided with a list of available updates by name, each with a corresponding number. For example, on a recent update, I was presented with the following output:

    Software Update found the following new or updated software:
    ! SecurityUpd2004-01-26Pan-1.0
         Security Update 2004-01-26, 1.0, 8000K [required] [restart]
    * AirPortSW-3.3
         AirPort Software, 3.3, 8752K [restart]

    Each update is followed by its version number, file size, whether or not Apple considers the update to be “required,” and whether or not a restart of the remote computer will be necessary after installing the update.

  3. To install an update, type one of the following commands:

    • sudo softwareupdate -i -a <RETURN> to install all updates

    • sudo softwareupdate -i -r <RETURN> to install all "required" updates

    • sudo softwareupdate -i nameversion <RETURN> to install a specific update, where name- version is the name of the specific update listed on the first line of the softwareupdate -l output. (The nameversion will never contain a space.)

  4. Provide your password when prompted; this will be your password on the target computer, not the computer from which you’re connecting. For example, to install the Security Update listed above, I typed the command sudo softwareupdate -i SecurityUpd2004-01-26Pan-1.0.

  5. When the installation is complete, you’ll see a message in Terminal letting you know that the update has been installed. If the update doesn’t require a restart, you can simply type exit to log out of the target computer. If the update requires a restart, you’ll receive a message telling you to restart immediately. Luckily, you can do this remotely, too. Simply type sudo reboot, and enter the required admin password at the prompt. You’ll be logged out of the target computer, and the target computer will restart. (Note that remote reboot isn’t the same as choosing Restart from the Apple Menu. Remote reboot doesn’t save documents or close databases—it simply kills every running process and restarts. If you think someone might be using the remote machine, or there may be unsaved documents open, it’s safer to ask the user to restart the machine, or to restart it yourself later.)

Tip

When using Software Update remotely, you can actually install more than one update at once. To do so, simply include the update names in the same command: sudo softwareupdate -i nameversion1 nameversion2 nameversion3 <RETURN>. The updates will be installed consecutively, and you’ll be notified when they’re all completed.

Changing the Startup Volume via Remote Login
User Level | admin
Affects | computer
Terminal | yes

Have you ever wanted to reboot your Mac OS X computer from a different startup volume, but you can’t because, well, your computer isn’t in front of you? Using Remote Login, you can do so, and restart your Mac remotely, as well. You may never need to use this trick, but if you do, it’s can be a life-saver, so to speak.

  1. Log in to the target computer remotely using SSH.

  2. Type df <RETURN> to get a list of available volumes on the remote computer. Look for the desired volume’s official name in the "Mounted on" column. (The name will be listed as /Volumes/volumename.)

  3. Type sudo bless -folder '/Volumes/volumename/System/Library/CoreServices' -setOF <RETURN>. (That’s all one line, with spaces after bless, -folder, and CoreServices'.) Provide your account password when prompted; this will be your password on the target computer.

  4. Type sudo reboot <RETURN> to restart the computer using the new startup volume.

Desktop Control: VNC, Timbuktu, Apple Remote Desktop

Remote Login is extremely powerful; however, it requires some knowledge of Unix commands, and it has a horrible user interface (unless you really like using a command line to get things done). There are times when it would be nice to actually see the screen of another computer and control it as if it were right in front of you. For example, helping someone troubleshoot a computer is much easier if you can see exactly what the other user is seeing. Another example is when you want to turn a Sharing service on or off in Sharing preferences—doing so is tricky in Terminal if you don’t know what you’re doing, but if you can control the mouse on the target computer from another computer, you can actually open System Preferences, switch to the Sharing pane, and click the appropriate box yourself. Finally, many parents with very young children like to monitor their child’s computer use.

There are a few great solutions for full “Desktop” control. The most basic, and least expensive, is what’s known as virtual network computing (VNC). By running a VNC server on a computer, VNC clients can connect to that computer, view its screen, and even control it—all from another computer on a local network, or even from a computer halfway around the world.

If you need more functionality than VNC, such as the ability to communicate with users of the target computer and even transfer files to it, you’ll want to consider a commercial solution such as Timbuktu or Apple Remote Desktop.

Using VNC on Mac OS X

There’s currently an open-source project dedicated to maintaining a VNC server for Mac OS X, called OSXvnc (http://sourceforge.net/projects/osxvnc/). There are several implementations of OSXvnc that you can install on your Mac, such as the "official" OSXvnc server (http://www.redstonesoftware.com/vnc.html) and the freeware Share My Desktop (http://www.bombich.com/software/smd.html). Both allow you to set up either a user-level server (one that can be started and stopped by any user and in fact requires a user to manually start and stop it) or a system-wide VNC server that’s enabled at startup. Share My Desktop is overall the easiest to use, in my opinion.

Starting a User-Level VNC Server Using Share My Desktop
User Level | any
Affects | individual user
Terminal | no

If you plan to use a VNC connection only once in a while—for example, when a user needs help— it’s probably better to simply have the user start the VNC server when needed. You can install a copy of Share My Desktop on each of your computers (in the /Applications folder so that any user can access it).

To start the VNC server, a user simply needs to launch Share My Desktop and click the large “Start sharing” button. The window will then show the connection information, including the IP address, the port number, and the password to connect, which Share My Desktop created for you automatically (Figure 11.11). The connection info is also copied to the clipboard so that the person starting the server can paste it into an e–mail and send it to the person trying to connect—a nice touch! (Keep in mind the caveats I mentioned in Chapter 10 about IP addresses when you’re behind a router.)

Figure 11.11: Share My Desktop shows you everything you need to know to connect to the local VNC server.

It’s as simple as that; your VNC server is up and running. However, there are a few options you can take advantage of via the Share My Desktop preferences dialog. You can create your own password, change the port used by the server (don’t use any port lower than 5900), hide the password (so that it doesn’t show up in the Share My Desktop window), and choose Energy Saver settings (so that the computer doesn’t go to sleep or dim the screen when someone else is accessing it).

When you’re done with the VNC server, you can stop it by simply clicking the “Stop sharing” button.

Starting a System-Level VNC Server Using Share My Desktop
User Level | admin
Affects | computer
Terminal | no

What if you want your VNC server to be available 24/7? For example, if you want to be sure that you can access your computer via VNC no matter the time or need, you’ll want the VNC server to always be running. Share My Desktop allows you to install a version of the VNC server in OS X’s Unix application directories and installs a system-level startup item (remember those from Chapter 3?) so that your VNC server is always running. Tech support staff frequently use this type of setup so that they can access computers and provide support when needed. Personally, I have the VNC server running continuously on my home computers so that I can perform administrative tasks and provide tech support for my family, even when I’m not at home.

To install the system-level VNC server, launch Share My Desktop and select File Ø Manage System VNC Server. Then follow these steps:

  1. Authenticate by clicking the padlock button and providing your admin password.

  2. Click Install System VNC to install the VNC software and startup item.

  3. Choose your server settings in the Step 2 box: Provide a password for the server (VNC clients will need to enter this password to connect), a preferred port number (again, 5900 or higher), and the name you want your computer to appear as when others connect via VNC. Check the “Start VNC server on startup” box, and, finally, decide whether you want to allow your computer screen to dim and/or your computer to go to sleep. (Keep in mind that if you let your computer go to sleep, users—including you—can only connect via VNC when it is awake.) Click Apply Settings.

  4. Click “Turn on System VNC” to start the VNC server.

Note

Once you’ve set up a system-level VNC server, you can’t control the server using the main Share My Desktop window; you have to use the Manage System VNC Server window.

Controlling Your Mac via a VNC Client

Once you’ve got the VNC server running on your Mac, you can connect to it using its IP address (including the port number) and the password you provided (or that Share My Desktop has provided for you). The only thing you need is a VNC client. There are VNC clients available for every platform, so you can actually connect to and control your Mac from any computer anywhere there’s Inter- net access. In terms of VNC clients for Mac OS X, a couple good ones are VNC Thing (http://www.webthing.net/vncthing/) and Chicken of the VNC (http://sourceforge.net/projects/cotvnc/—yes, that’s the actual name of the software). I prefer VNC Thing, mainly because it allows you to resize the client window (it scales the display to fit) and because it allows you to "bookmark" VNC servers.

To connect to a VNC server using VNC Thing, choose File Ø New Session… The connection dialog is extremely simple: Enter the IP address of the server, including the port number, and the password (not your personal password, but the VNC server’s password). There are a few other options available to you by clicking the disclosure triangle at the bottom of the connection window; the most useful is “Shrink to fit,” which automatically shrinks your view of the server’s Desktop to fit the VNC Thing window. When you click OK, a window will appear showing you the server’s Desktop; by default this window covers the entire screen, but you can resize it to whatever size you choose (Figure 11.12).

Click To expand
Figure 11.12: A VNC client/server connection lets you control one Mac from another.

When you move your cursor over the VNC Thing window, you’ll notice that it changes to a smaller cursor; this means you’re actually controlling the cursor on the remote computer. Anything you do with the mouse and keyboard here are actually taking place on the remote computer.

Although VNC technology is very cool and quite useful, there are a few caveats to keep in mind:

  • Because using VNC is so graphics-intensive, performance isn’t great—you’ll notice that when you move windows around on the remote computer, it takes a bit of time—sometimes as long as a few seconds—for the client window to reflect the changes.

  • Your Mac must be able to communicate via IP with the computer that’s trying to connect. If you or another user is trying to connect to your Mac over the Internet, your Mac must currently be connected to the Internet. If you or another user is trying to connect from a computer on a local network, your Mac needs to be connected to the network and have a local IP address.

  • Unlike Remote Login, which lets you log in as any user, VNC lets you see and control the computer as whichever user is currently logged in. Remember that you’re not really logging in; you’re simply seeing whatever is going on on-screen. If you have a system-level VNC server installed, this means that you can actually log in and out of accounts (as the VNC server will let you connect even when no other users are logged in, so you can see and use the login screen). However, if you rely on a user-level server, you can connect only when a user has started the server manually, and if that user logs out, the VNC server will be shut down.

If you like the idea behind VNC, read on for a couple of options that provide significantly more functionality.

Timbuktu and Apple Remote Desktop

OSXvnc server and its clients are actually very good considering their cost—free! However, if you need more functionality, you may want to consider a commercial software package such as Timbuktu Pro (http://www.netopia.com/software/products/tb2/mac/index.html) or Apple’s own Apple Remote Desktop (http://www.apple.com/remotedesktop/).

Both of these software packages provide all of the remote control functions of OSXvnc, but they add features such as the ability to transfer files to and from the remote computer by simply dragging them from the Finder on your Mac to the screen of the remote Mac (or vice versa); real-time text and voice chatting with the remote computer; and the ability to get detailed technical information about the remote computer, which can be helpful if you’re trying to troubleshoot a problem on that machine.

Timbuktu is more appropriate for one-to-one connections—helping someone troubleshoot a problem, working with someone on a document, etc.—so its functionality is focused on letting you interact with one computer at a time. Perhaps its most useful feature is its ability to locate, and connect to, other Timbuktu computers over the Internet, even if those computers have dynamic IP addresses. The developers of Timbuktu maintain an Internet Locator Service that keeps track of the IP addresses of computers running Timbuktu; you type the e–mail address of the user of the remote computer, and Timbuktu finds its current IP address and connects you to it. As a side note, there’s also a Windows version of Timbuktu; you can access and control Windows computers using a Mac, and vice versa.

Apple Remote Desktop (ARD), on the other hand, is aimed at “group” interaction, such as classrooms or training sessions and managing multiple computers. You can observe, control, or share the screens of an entire room or network of computers. In fact, you can view up to four remote screens at a time; ARD tiles them on your local screen. You can even take one remote screen and “share” it with every other connected computer. ARD also lets you perform software/system updates on remote computers—very handy for keeping all your Macs up-to-date.

Unlike Timbuktu, ARD uses technology actually built into Mac OS X—you set up access privileges for ARD using the Sharing pane of System Preferences. Select Apple Remote Desktop, and click the Access Privileges… button; you can then set up privileges for each user.

Both Timbuktu and Apple Remote Desktop offer a good amount of additional functionality not described here; check out their websites for complete info. If you need their additional functionality, I think both are well worth the money.


Moving On...

Team LiB

Moving On…

While I’m on the topics of networks, sharing, and connecting, another related topic is printing—connecting to printers, sharing printers, and configuring printers. In the next chapter I’ll cover printing in OS X, from the basics to more advanced features and functionality.


Chapter 12: Printing Practicalities (and Fax Features)

(Or: Enhancing printing functionality, supporting unsupported printers, and answering (print) pressing questions.)

If you’ve been using Mac OS X for a while, you may already have a printer hooked up and working. In this chapter I’ll show you how to take advantage of OS X’s advanced printing technologies to manage printers and print jobs, share your printer with other computers, print remotely, and print in Classic. I’ll also show you how to add a few needed or helpful features using third-party software.

However, if you’re coming to Mac OS X from OS 9 or Windows—or even if you’ve recently upgraded from an older version of OS X—you may have found that your old printer no longer works in OS X 10.2 or later. In this case, I’ll also show you how to take advantage of OS X’s open-source roots to (I hope) get your old printer up and running.

Printing Basics

Before I talk about setting up and managing printers in OS X, you should know a bit about types of printers and printing connections, how to install additional supported printer drivers and PPDs, and some background on OS X’s printing system.

Printer Types

There are generally two kinds of printers on the market today: PostScript and non-PostScript. PostScript, a standard printing/programming language, was once available only on expensive laser printers but has recently become common even on lower-priced printers. OS X includes a universal PostScript driver that provides basic support for any PostScript Level 2 or Level 3 printer, and supports additional printer-specific features (multiple paper trays, varying print quality, etc.) via PostScript Printer Description (PPD) files. Note that because of this built-in PostScript driver, OS X can print to any PostScript Level 2 or Level 3 printer right out of the box; however, you may not be able to access features specific to a printer until you install and/or select its correct PPD file. (However, as I’ll explain in a moment, this is often done for you automatically.)

Non-PostScript printers, such as many inkjet printers, use a technology known as Printer Control Language (PCL); PCL printers don’t take advantage of a universal printing engine, so each printer requires its own driver (which also supplies information about printer-specific features). The downside to PCL is that, unlike PostScript printers, if you don’t have the proper driver, your printer usually won’t print at all.

Luckily, many PPD files and non-PostScript printer drivers are pre-installed with OS X, so your Mac supports an impressive number of printers right out of the box.

Note

You can see the official list of printers supported by OS X at http://www.apple.com/macosx/upgrade/printers.html. An unofficial list is maintained at http://www.index-site.com/printersx.html. You can also see a list of provided PPD files at http://docs.info.apple.com/article.html?artnum=25587 and a list of pre-installed inkjet printer drivers at http://docs.info.apple.com/article.html?artnum=25588. Note that in many cases a driver will also work with closely related printers from the same printer manufacturer and model line.

Printer Connections

Whether or not a printer is usable with OS X depends not only on whether or not a printer driver or PPD file is available for it but also on whether or not it can connect to your Mac. OS X supports non-AppleTalk printing via USB, Ethernet, FireWire, Bluetooth, and serial ports. It also supports many serial-to-USB and parallel-to-USB adapters, so it’s often possible to use older serial and parallel printers even if your Mac doesn’t have the right ports.

Unfortunately, support for AppleTalk printers is much more limited; only those that can be connected via Ethernet are (officially) supported. (If your LocalTalk printer is still worth a good deal of money, you can buy a third-party LocalTalk-to-Ethernet bridge; however, for inexpensive printers, the cost may not be worth it.)

Mac OS X can also print to any supported printer connected to a local network, whether that network is Ethernet, AirPort/wireless, or FireWire, and can even print over the Internet to printers that have their own IP address.

Note

After reading the previous two sections, you may have noticed that OS X doesn’t “officially” support a good number of printers—including many older printers from Apple. In addition, a number of newer printers (especially “multifunction” models) don’t yet have official drivers available. I’ll show you how to add support for many of these printers—or, in the case of OS X 10.3 or later, take advantage of unsupported printer drivers that are included with OS X—later in the chapter (see “Supporting Unsupported Printers”).

Installing “Supported” Printer Drivers and PPDs

User Level | admin
Affects | computer
Terminal | no

In addition to OS X’s built-in drivers and PPDs, many printer manufacturers release new printer drivers that either aren’t part of OS X’s library or are more recent versions of drivers that are. Some are automatically made available to you through Mac OS X’s Software Update system. However, because many aren’t, you should always check the website of the manufacturer of your printer to make sure you have the latest version. If an updated or new driver is available, download it and follow the included installation instructions; in most cases this requires an administrator account. If the down- loaded file is simply a PPD, you should manually place it in the appropriate Printers directory (see the sidebar “Where Are the Printer Drivers?”).

Reinstalling/Installing OS X’s Printer Drivers

There are a couple situations where you may not have the full complement of stock OS X printer drivers and/or PPD files: (1) You installed OS X yourself, and in the Customize dialog you unchecked some or all printer drivers; or (2) you manually removed drivers and PPDs to free up space on your hard drive (see “Cleaning House: Removing Unnecessary Printer Drivers,” later in this chapter). Whatever the reason, it’s possible that you might need some of those drivers back later. Here’s how to get them:

  1. Insert Disc 2 of your Mac OS X Install CDs (or DVD).

  2. Locate the file AdditionalPrinterDrivers.mpkg (or .pkg—some versions of the package use a different file extension) inside the Packages folder, and double-click it. This launches the OS X Installer application. Alternatively, you can (or may need to, depending on the version of the Install CD/DVD you have) install the package for your particular brand of printer; e.g., CanonPrinterDrivers.pkg, EpsonPrinterDrivers1.pkg, etc.

  3. Select your startup volume as the destination for installation, and then click Continue.

  4. Provide your admin password, if prompted.

Note that some Epson printer drivers are located on OS X Install Disc 3, instead of Disc 2. If you install the Epson drivers from Disc 2 and it doesn’t install the drivers for your Epson printer, try installing the EpsonPrinterDrivers2.pkg from Disc 3.

CUPS: OS X’s Printing System

Although most users never think twice about the guts of their computer’s printing system, in the case of Mac OS X it’s actually a useful topic to broach. OS X has always had a fairly advanced printing system; however, beginning with OS X 10.2, Apple completely replaced the previous printing engine with the Common Unix Printing System (CUPS). CUPS, originally developed by Easy Software Products (http://www.easysw.com/), was created to provide an open-source, standard printing architecture that any version of Unix could use. Apple decided to take advantage of OS X’s Unix roots by licensing CUPS and using it as the basis for printing in OS X.

CUPS provides many of the features you’d expect from an advanced printing system (many of which I’ll talk about in this chapter): print queuing, spooling, and management; network browsing and directory services for printers; print logging and accounting; print filtering; and a large number of built-in drivers for popular printers. However, it also provides convenient command-line and Web-based management, and its open-source nature makes it extensible not just by Apple but also by third-party developers and even users.

CUPS means three things for you as a user. First, it means that it’s easier for printer manufacturers to write drivers that will work with OS X. Second, it means that it’s easier for others to develop printer drivers when the manufacturer won’t—this is a major benefit, as I’ll explain a bit later in the chapter (see “Supporting Unsupported Printers”). Finally, because CUPS can be managed from both a Web browser and via Terminal commands, OS X’s printing system has become one of the most flexible and adaptable of any OS on the market.

Tip

If you’re interested in learning more about CUPS, visit http://www.cups.org/ or view the documentation already installed on your computer at http://localhost:631/documentation.html.

Start Sidebar
Where Are the Printer Drivers?

In Mac OS X, printer drivers and support files are located in several places. The basic printing interfaces, as well as PPD files for Apple printers, are installed by Mac OS X in /System/Library/Printers. Third- party printer drivers and PPDs—both those installed by OS X and those installed manually by users— are located in /Library/Printers. It’s also possible for users to install printer drivers and/or PPDs in ~/Library/Printers, but those drivers and PPDs will be available only to the user who installs them.

End Sidebar


Printer Prep: Setting Up and Managing Printers in OS X

Setting up a printer in OS X is remarkably easy as most printers are genuinely “plug and play.” Provided you have the appropriate driver or PPD file installed, when you connect a printer to your Mac, OS X will automatically detect it, recognize the manufacturer and model, select the appropriate driver or PPD file, and create a print queue for it. However, there are several ways you can access printer options, manage printers, and customize print queues in OS X, and there may be times when you need to set up a print queue/printer manually. The two most common and convenient ways to manage printing in OS X are Printer Setup Utility and the new CUPS Web interface.

Note

The OS X 10.2 equivalent to Printer Setup Utility is Print Center. Apart from a few major differences, which I’ll note in the text, the two utilities work similarly. In fact, under OS X 10.3 and later, there’s an invisible alias called Print Center in the Utilities folder that points to Printer Setup Utility; this is provided for compatibility with software written for OS X 10.2 that looks for an application called Print Center.

In the previous paragraph I mentioned print queues. When you add or set up a printer in OS X, what you’re really doing is creating a print queue. OS X uses this queue to manage jobs for the printer. When you print “to” a printer, you’re actually sending a document to its queue; when the printer is available, the next document in the queue is printed. As I talk about managing printers and print jobs, it’s helpful to remember this distinction.

It’s also possible to manage printers and print queues using Terminal and NetInfo Manager. However, Apple has provided Printer Setup Utility and the CUPS Web interface so that you can avoid having to use these tools, so I’m not going to spend time on them here.

Using Printer Setup Utility

User Level | any
Affects | all users
Terminal | no

The hub, if you will, of printing in OS X is Printer Setup Utility (/Applications/Utilities/ PrinterSetup Utility). Using Printer Setup Utility, you can add and delete printers, configure print- ers, and start/stop/manage print queues (Figure 12.1). The sections that follow show you how to use Printer Setup Utility and how to take advantage of some features that aren’t quite obvious.

Click To expand
Figure 12.1: The Printer List window of Printer Setup Utility
Warning

I mentioned in Chapter 7 that you shouldn’t move Apple’s applications from their default locations. This is especially true for Printer Setup Utility (Print Center in OS X 10.2); if you move it out of the Utilities folder, you may not be able to print.

Adding Printers

As I mentioned previously, in most cases OS X will automatically detect and configure your printer when you connect it. However, in the event your printer isn’t automatically set up in Printer Setup Utility, you’ll need to set it up manually. (This is also generally the case when you need to add a printer that isn’t connected directly to your Mac; for example, if you connect to the printer over a network.) How you manually add a printer depends largely on how it’s connected.

Note

Printers shared by other Macs on your local network, via Printer Sharing, should be set up automatically and will appear in Printer Setup Utility under Shared Printers. (I discuss Printer Sharing later in this chapter under “Sharing Your Printer.”)

Adding USB, Rendezvous, and AppleTalk Printers

If the printer you want to use is connected to your Mac via USB or is accessible over a local network:

  1. Click the Add Printer toolbar item (or choose Printers Ø Add Printer…).

  2. In the resulting dialog, choose the connection method—USB, Rendezvous, or AppleTalk— from the pop-up menu. A Rendezvous printer will generally be a printer that’s shared by another Mac running OS X or a network printer that supports Rendezvous. (For more on Rendezvous, see Chapter 9.) If you select AppleTalk and your network is divided into Apple-Talk zones, choose the zone in which the printer is located from the zone pop-up menu. (You may see other options here that have been provided by third-party printer drivers; e.g., Epson AppleTalk and Epson USB. The applicability of these other options is generally fairly obvious. For example, Epson printers that connect via AppleTalk may not be visible under the AppleTalk item; you need to select Epson AppleTalk instead.)

    Note

    Under OS X 10.2, if you’re trying to add a printer that’s being shared by another Mac OS X computer over a local network (via Printer Sharing), you must first enable “Show printers connected to other computers” in Print Center preferences. (In OS X 10.3 or later, you’ll see these printers automatically.)

    Note

    To connect to an AppleTalk printer, make sure AppleTalk is enabled for the appropriate connection type (Ethernet, AirPort, etc.) in Network preferences. (Depending on the version of Mac OS X you’re running, you may also need to enable AppleTalk in the Directory Access utility, as noted in Chapter 11.)

  3. A list of printers available to you via the chosen connection method will appear. Select the printer you want to add. In most cases, OS X will automatically select the correct printer driver or PPD for the printer (assuming it’s available on your Mac), and “Auto Select” will be shown at the bottom of the dialog. If you see “Generic” or an incorrect model number listed, choose the correct manufacturer from the Printer Model pop-up, and then select the correct model number from the list of printer models from that manufacturer that will appear. If you still don’t see the correct PPD or driver for your printer, but you know it’s installed, you can choose Other… from the pop-up menu and navigate to it manually.

  4. Click Add to add the printer.

Adding LPR Printers (to Print via IP)

If you have access to a printer that has its own IP address (common in business environments), you can print to it over a local network or the Internet via Line Printing (LPR). However, setting up an LPR printer is slightly different from adding most other printers:

  1. Click the Add toolbar item or choose Printers Ø Add Printer…

  2. In the resulting dialog, choose IP Printing from the pop-up menu.

  3. From the Printer Type pop-up menu, choose the appropriate item: LPD/LPR, Internet Printing Protocol, or Socket/HP Jet Direct. (Contact the administrator of the printer if you’re not sure which to choose.)

  4. Enter the IP address (or domain name, if applicable) of the printer in the Printer’s Address field. If you’re printing to a print queue on a server, enter the IP address of the queue instead.

  5. If you’re using a Socket/HP Jet Direct printer, you need to provide a Queue Name. This will be the name of the printer in Printer Setup Utility and in Print dialogs. If you’re using another kind of IP printer, you can provide a Queue Name, if you want, or you can leave the field blank to use the default Queue Name provided by the printer or print server.

  6. You can print using the “Generic” Printer Model setting, but to take advantage of printer-specific features, choose the printer manufacturer from the Printer Model pop-up. A list of models from that manufacturer will appear; select the appropriate model.

  7. Click Add to add the printer.

Adding a Printer Shared by a Windows Computer

Thanks to Mac OS X’s built-in Samba support, you can print over a local network, or even over the Internet, to a printer connected to—and being shared by—a Windows computer. There are actually two ways to add such a printer in Printer Setup Utility.

Note

In OS X 10.2, many users have found that they can’t print to a printer shared by a Windows computer until they launch Terminal, type sudo ln -s /usr/bin/smbspool /usr/libexec/cups/backend/smb <RETURN>, and then restart. Once that step is out of the way, printing to printers shared by Windows computers should work fine forevermore.

If you’re running OS X 10.3 or later, try these steps first:

  1. Click the Add toolbar item (or choose Printers Ø Add Printer…).

  2. In the resulting dialog, choose Windows Printing from the pop-up menu.

  3. From the WORKGROUP pop-up, choose the workgroup in which the printer is located.

  4. The desired printer should appear in the printer list; select it.

  5. Choose the printer manufacturer from the Printer Model pop-up menu, and then select the specific printer model from the list of models.

  6. Click Add to add the printer.

If you’re running OS X 10.2, or if for some reason the steps above didn’t work for you in OS X 10.3 or later, try the following:

  1. Hold down the option key and click the Add Printer toolbar item—this enables some advanced features in the Add Printer dialog.

  2. From the pop-up menu, choose Advanced (it should appear at the bottom of the menu).

  3. In the resulting Advanced dialog, choose “Windows Printer via SAMBA” from the Device pop-up menu.

  4. In the Device Name field, enter a name for the printer queue you’re setting up.

  5. Enter the SMB URL of the printer in the Device URI field; use the format smb://user-name:password@workgroup;serveraddress/printer. Serveraddress is the name of the server or computer that’s sharing the printer, and printer is the name of the printer share set up on the Windows computer. If a username, password, and/or workgroup aren’t required, you can leave them out (e.g., use smb://serveraddress/printer).

  6. Choose the printer manufacturer from the Printer Model pop-up menu, and then select the specific printer model from the list of models.

  7. Click Add to add the printer.

Note

Since many Windows printers don’t have drivers or PPD files for OS X, you may need to install third-party drivers in order to print to a printer shared via Windows. See “Supporting Unsupported Printers,” later in this chapter.

Adding a Printer via Open Directory

OS X also supports Directory Services, which are common in large network environments. To add a printer that’s available via Open Directory, simply choose Open Directory from the pop-up menu in the Add Printer dialog (instead of USB, IP Printing, etc.). You’ll get a list of available printers; select one, and then click Add. All printer configuration has already been handled by your network administrator.

Configuring Printers/Print Queues

Once you’ve added a printer/print queue to Printer Setup Utility, you have two ways to customize and configure it. The first, available for all printers, is to select the printer and choose Printers Ø Show Info (or click the Info item in the toolbar). The resulting Printer Info window has three panels, accessible from the pop-up menu. The Name & Location panel allows you to rename the printer— this is the name that shows up in the Printer Setup Utility window as well as in the Printer pop-up menu in Print dialogs. The Location field in the same panel is a description of the printer’s location; you can change this to something more meaningful to you (e.g., Room 3027) if you like.

The second panel, Printer Model, is generally fixed for non-PostScript printers. However, for PostScript printers, you can use the manufacturer pop-up menu to change the PPD file associated with your printer. Choose the printer’s manufacturer, and a list of installed PPDs for that manufacturer’s printers will appear in the Model Name box; select the desired one. If your PPD isn’t listed, you can choose Other… from the menu and navigate to it manually. This is a handy way to change the PPD used for a printer without having to delete the queue and re-create it.

Finally, the Installable Options panel provides a way to choose settings for printer-specific features—these features, such as default paper tray and memory settings, are actually provided by the PPD file you’ve chosen for the printer. Once you’ve made changes to a printer using the Show Info window, click Apply Changes to save them.

Tip

Although OS X is very good about automatically selecting the appropriate printer driver/PPD file for a new printer, it sometimes doesn’t configure the new print queue to take advantage of all of your printer’s installed options. Be sure to check the Installable Options panel to make sure you’re taking full advantage of features such as multiple paper trays and extra printer RAM, if applicable.

The second way to configure a printer—and this option is available only for inkjet printers— is by using the third-party printer utility for your model of printer. These utilities are located in /Library/Printers, by manufacturer. For example, the utility for my Canon inkjet printer is located at /Library/Printers/Canon/BJPrinter/Utilities/BJPrinterUtility. Luckily, you don’t have to dig through your hard drive to access these utilities; simply select your printer in Printer Setup Utility, and choose Printers Ø Configure Printer (or click the Utility or Configure toolbar item). The printer utility for your printer will automatically be launched. These utilities vary in their functionality, but most let you clean print heads, check ink tank levels, and set printer-specific options. (Note that third-party printer utilities don’t work if your printer is connected to an AirPort Base Station’s USB printer port. Likewise, you can’t configure an inkjet printer that’s being shared by another Mac; you have to configure it from that Mac.)

Tip

In addition to the printer-specific options discussed here, you can set a few general printing preferences in the Print & Fax pane of System Preferences, which I discuss later in this chapter.

Deleting Printers

To delete a printer (which deletes the printer’s queue, as well), select the printer in Printer Setup Utility and click the Delete toolbar item (or choose Printers Ø Delete Selected Printers). If there are print jobs queued for that printer, you’ll be asked if you want to wait for them to finish or delete the printer immediately (which cancels pending print jobs).

Note

You can’t delete printers being shared by other Macs (those printers that show up in Printer Setup Utility under Shared Printers)—these printers’ queues are actually hosted on the computer to which they’re directly connected. (I discuss Printer Sharing later in this chapter.)

Managing Print Queues

As I previously mentioned, every printer you add to Printer Setup Utility is actually a representation of a print queue that’s used by OS X to manage jobs for the respective printer. This is an important distinction because it means that up until the very last moment, when the print job is spooled to your printer for printing, it’s actually queued on your computer (or, if printing to a printer hosted by another Mac, on that computer). Printer Setup Utility provides you with a way to manage these queues. In fact, under Mac OS X 10.3 and later, each printer queue is further represented by a printer queue application, named using the name of the printer queue it represents; you can see these applications in ~/Library/Printers. When you print a document, the printer queue application for the appropriate printer launches and appears in the Dock—showing you the number of pages left to print via its Dock icon—and then quits when the job finishes printing. (If you don’t want the printer application to quit after the job finishes, simply switch to it via the Dock while the job is printing; it will then stay open until you manually quit it.)

Stopping/Starting Print Queues

If you want to put all print jobs for a particular printer on hold, select the printer in Printer Setup Utility and then choose Printers Ø Stop Jobs; the queue for the printer will be stopped. You can still “print” to the printer queue, but your documents will not actually be sent to the printer until you restart the queue (by choosing Printers Ø Start Jobs). You can also double-click a printer name in Printer Setup Utility, or select it and choose Printers Ø Show Jobs, to view its queue—you’re actually launching the printer queue application—and then click the Stop Jobs toolbar item to put the printer queue on hold. The toolbar items changes to Start Jobs to indicate that the queue is currently stopped (Figure 12.2). Click Start Jobs to resume the queue.

Note

You can’t stop/start print queues for a printer that’s being shared by another Mac via Printer Sharing; you can only do so from that Mac.

If you or any other user tries to print to a stopped queue, you’ll receive a dialog asking you if you want to cancel the printing of the current document, restart the queue, or simply add your document to the queue. If you choose the latter, your document will be printed whenever the queue is started again. In fact, under OS X 10.2 and later, when you click the Printer pop-up menu in any Print dialog, you’ll see an exclamation point next to those printers that are currently on hold.

Figure 12.2: Stopping a printer queue via the Show Jobs window
Tip

Use print queues to your advantage: If you’re on the road with your PowerBook or iBook (or if you’re at home, but for some reason your printer is unavailable), stop the print queue for your printer. You can print as many jobs as you like, and they’ll all be queued. Once you’re connected to your printer again, start the queue, and all of your print jobs will be printed.

Holding Individual Print Jobs

There are times when you want to hold a particular print job, but not all print jobs. As an example, sometimes I print documents at a friend’s home office; he doesn’t mind a few pages here and there, but he’d be a bit less understanding if I tried to print a 150-page software manual using his inkjet printer. You can actually put an individual job on hold but still allow other jobs to proceed. (This can also be quite helpful if you have a small print job stuck behind a large one; you can put the large one on hold until the small one prints.)

To do this, select the appropriate printer/print queue in Printer Setup Utility and then choose Printers Ø Show Jobs (or double-click the printer in the list or its printer queue application in the Finder). You’ll see the list of currently queued jobs at the bottom of the window. Select the job you want to hold, and then click the Hold toolbar item (or choose Jobs Ø Hold Job). The Status column changes to “Hold,” and the document will not print until you select it and click the Resume toolbar item (or choose Jobs Ø Resume Job). Other jobs in the queue, however, will print normally.

Deleting Print Jobs

If you ever change your mind about printing a document—perhaps you realize that you need to make a few changes—you can delete individual jobs or all jobs at once. Open the affected printer queue (by choosing Printers Ø Show Jobs in Printer Setup Utility or by double-clicking the printer queue application in the Finder), and then select the job you want to delete (command-click to select multiple jobs). Click the Delete toolbar item and the print job(s) will be permanently deleted. Note that if the job has already started printing, any pages that have already been spooled to your printer will still print.

Moving Jobs between Printers/Print Queues

If you’ve printed a document to one printer and decide that you’d rather print it to another, it’s actually easy to do so (assuming, of course, that the job is still in the queue and hasn’t yet printed). Open the print queue the document was originally printed to (by double-clicking the printer or by selecting the printer in Printer Setup Utility and choosing Printers Ø Show Jobs), and then drag the job (or multiple jobs) from the queue window onto the desired printer in the main Printer Setup Utility window (or into the desired printer’s own Show Jobs window); the print job(s) will be moved to the new printer’s queue.

Tip

In addition to dragging print jobs between printers, you can actually drag documents themselves onto printers in Printer Setup Utility, into a printer’s Show Jobs window, or onto a printer queue application to print them. I’ll talk more about this feature later in the chapter (see “Printing Pointers”).

Creating Printer Pools

In OS X 10.2, you can create printer classes—collections of printers, grouped together to use a single printer queue—using the CUPS Web interface (see “Using the CUPS Web Interface,” later in this chapter). In OS X 10.3 and later, Apple has provided similar functionality, called pooling, from within Printer Setup Utility. When printers are pooled, instead of printing to a particular printer, users can print to the pool; the print job is queued to the pool queue rather than an individual printer queue. Jobs in the queue are then forwarded to the first available printer in the pool. Although printer pools are probably overkill for most home users, in large network environments these pools help distribute printing among several printers, spreading the workload and generally ensuring that print jobs are processed as quickly as possible.

Unfortunately, when you print to a class, you don’t get any feedback letting you know which printer actually handled the job, so this feature is most useful when the printers in the class are located physically near each other.

Creating a pool of printers is actually pretty simple:

  1. Using Printer Setup Utility, set up the individual printers that will be included in the pool.

  2. In the Printer Setup Utility window, select the printers to be included in the pool by command-clicking them.

  3. Choose Printers Ø Pool Printers.

  4. In the resulting dialog, provide a name for the printer pool, and then drag the printers up and down to determine their priority. (When a user prints to the pool, Mac OS X will first check the printer at the top of the list; if that printer is busy, it will check the second, and so on, until it finds a printer that’s available.) If you change your mind about the order later, you’ll need to delete the pool and create a new one with the desired order.

  5. Click the Create button to create the printer pool.

The newly created printer pool will appear in the printer list in Printer Setup Utility and in the Printer pop-up menu in Print dialogs.

Tip

If you enable Printer Sharing (discussed later in this chapter), any printer pools you’ve created will also be shared. You’ve created, in effect, your own multiple-printer print server!

To delete a printer class, select it in Printer Setup Utility and then click the Delete toolbar item (or choose Printers Ø Delete Selected Printers).

Customizing Printer Setup Utility

User Level | any
Affects | individual user
Terminal | no

In addition to the features I’ve already mentioned, Printer Setup Utility has a few options of its own that can make it a bit more convenient to use. Like most Cocoa applications, you can customize the Printer Setup Utility toolbar. In addition to the standard toolbar items—Make Default, Add, Delete, Utility, ColorSync, and Show Info—you can also include buttons to show pending jobs or stop/start jobs for a particular print queue.

In addition—and this is one of the hidden gems of Printer Setup Utility—you can add several columns to the Printer Setup Utility window that provide very useful information. The View Ø Columns sub-menu lists several columns that you can show or hide. By enabling these columns, the main Printer Setup Utility window can show you a good deal of additional information about each printer, including whether it is stopped or printing; the actual driver or PPD used by the printer; whether it’s a local or remote printer and, if remote, which computer or server is sharing it (“Host”); the printer’s Location note (normally only visible in the Show Info window); and the number of jobs currently in its queue.

Tip

If you have a lot of printers set up (this can happen if you’ve used several different printers or if there are a lot of network and/or shared printers accessible by your Mac), uncheck the “In Menu” box next to any printers that you don’t use. (In OS X 10.2, you need to enable the Favorites column to do this.) All printers will still show up in Printer Setup Utility, but only those checked will show up in the Printer pop-up menu in Print dialogs.

Print & Fax System Preferences, Part 1: Printing

User Level | any or admin, depending on setting
Affects | individual user or computer
Terminal | no

In OS X 10.3, Apple added a new pane to System Preferences called Print & Fax. I’ll talk about the Faxing tab of this pane later in this chapter, but here’s a quick summary of the four options available in the Printing tab.

The Set Up Printers… button simply launches Printer Setup Utility. That’s it. Any user can use this option.

The “Selected printer in Print Dialog” pop-up menu determines the default printer when you print a document. If you choose “Last printer used,” the printer you used for the previous print job will be selected the next time you print. If you choose a particular printer from the menu, that printer will always be the default, regardless of the printer used for the previous print job. (Choosing Edit Printer List… from the menu also opens Printer Setup Utility. Apple’s philosophy seems to be “You can never have too many ways to open Printer Setup Utility.”) Any user can set this option for their own account. (You can also choose a default printer from within Printer Setup Utility by selecting a printer from the printer list and then clicking the Make Default toolbar item or choosing Printers Ø Make Default.)

Tip

In OS X 10.2, you can set a default printer by selecting the printer in Print Center and then clicking the Make Default toolbar item (or choosing Printers Ø Make Default). However, unlike OS X 10.3 or later, printing from a different printer—by choosing it in a Print dialog—makes that printer the default, regardless of which printer you choose as the “default” in Print Center.

The “Default paper size in Page Setup” pop-up menu determines your preferred paper size. You can choose another paper size for any print job; however, this setting will be the default. Any user can set this option for their own account. (Under OS X 10.2, this setting is located in the Print Center preferences dialog.)

Finally, the “Share my printers with other computers” option duplicates the Printer Sharing option in Sharing preferences, which I talk about later in this chapter (see “Sharing Your Printer”). Only admin users can enable/disable this option.

Using the CUPS Web Interface

User Level | any
Affects | all users
Terminal | no

Although some of the benefits provided by CUPS—such as the ability to write new drivers and to manage printing via the Terminal—are tasks that most users will never undertake, CUPS’ Web interface is handy for even the novice user. You can access this interface from any Web browser by entering the address http://127.0.0.1:631/. (You may need to enable Printer Sharing in Sharing preferences before this URL will work; you can then disable Printer Sharing if you’re not using it.) I’ll show you how to use some of its features over the next few pages.

Note

You can theoretically access any OS X Mac’s CUPS Web interface via http://IPaddress:631/. However, by default, only someone accessing the CUPS Web interface from the same computer can make changes. If you want to prevent others from viewing the Web interface on your computer at all, you should block port 631 using a firewall, as described in the next chapter.

As you’ll see in some of the examples I present, for most printer/print queue management, Printer Setup Utility is much easier to use. However, some features are available only via the Web interface. If you’d like to learn more about CUPS or the CUPS Web interface than what I include here, the CUPS Software Administration Manual is available at any time (it’s actually installed on your computer) at http://127.0.0.1:631/sam.html.

Note

The address http://127.0.0.1 is a URL that tells your Mac to connect to itself rather than to another computer. Your Mac may also be able to connect to itself by using its own Rendezvous name: http://RendezvousName.local. In fact, sometimes Mac OS X—in the interest of "ease of use"—will tell your Web browser to substitute the latter URL for the former. Unfortunately, the CUPS Web interface will not allow you to make any changes to printers or print queues unless you specifically use http://127.0.0.1. If you can’t connect to the CUPS Web interface, or if you can connect but get an error that "You don’t have permission to access the resource on this server" when you try to make changes, check the URL and make sure you’re accessing 127.0.0.1:631, not RendezvousName.local:631.

Adding Printers via the CUPS Web Interface

If you’re connecting to a networked printer and you have the printer’s address, it’s fairly simply to use the Web interface to add the printer. (For USB printers, you're generally better off using Printer Setup Utility.)

  1. Go to http://127.0.0.1:631 in any Web browser (on your own computer, of course).

  2. Click the Do Administration Tasks link.

  3. In the Printers section, click Add Printer (Figure 12.3).

    Click To expand
    Figure 12.3: CUPS’ printer administration Web page

  4. Give your printer a name, location, and description (e.g., Office_Printer, Room 3027, Laser Printer on 3rd Floor). Note that the printer’s name is actually the queue name and can contain only letters, numbers, and the underscore symbol. The “description” field will show up later in Printer Setup Utility as the “name” field. (These fields are mainly used for identification purposes, which can be quite helpful if you have a number of printers.) Click Continue.

  5. On the Device screen, choose the appropriate connection method from the Device pop-up menu—this is the connection or protocol used to communicate with the printer. For LPD printing, select “LPD/LPR Host or Printer”; for a printer being shared by a Windows computer, select “Windows Printer via SAMBA”; and so on. Note that in some cases, you’ll actually see your printer listed in this menu; that means OS X automatically recognized it. Click Continue.

  6. On the Device URI screen—note that you won’t see this screen if your printer was specifically listed, and selected, on the Device screen—enter the URI (Uniform Resource Identifier, similar to a URL) for the printer. For networked printers, this will be in the format http://, ipp://, or smb://, as described earlier when I talked about setting up printers using Printer Setup Utility. Generally the person who manages the printer will be able to provide you with the correct URI (or your printer’s manual will tell you how to get it). If your printer is connected via USB, open Terminal and type lpinfo -v <RETURN> to get a list of connected devices and their URIs; for example, my laser printer has a URI of usb://Samsung/ML-1210?serial=0. (Although if you have a USB printer, I highly recommend using Printer Setup Utility rather than the Web interface.) Click Continue.

  7. On the Model/Driver screen, select your printer’s manufacturer, and then click Continue. You’ll then see a second Model/Driver screen; select the correct PPD file or driver for your printer. Click Continue.

You should get a message that your printer has been added successfully. You can open Printer Setup Utility and see the printer just as if you’d added it from within Printer Setup Utility.

Tip

If the CUPS Web interface didn’t provide the correct PPD file as one of the choices in Step 7, you can choose any PPD file during the process of adding the printer, and then later change to the correct one using Printer Setup Utility’s Show Info window.

Configuring/Modifying Printers via the CUPS Web Interface

Just as you can use the Show Info window in Printer Setup Utility to change the name, location, and PPD for a printer, you can use the CUPS Web interface to change these settings from your Web browser. From the main CUPS screen, click Manage Printers. Scroll to the printer you want to modify, and click Modify Printer (you can also click the printer name or icon to go to a dedicated screen for that printer and then click Modify Printer).

The Modify Printer procedure walks you through the same steps you would go through to add a printer; however, the existing values for your printer are already entered. On each screen, make any desired changes and then click Continue. (Simply click Continue if no changes are needed on a particular screen.) This feature basically lets you alter an existing printer’s name, location, address, and/ or PPD file without having to delete it and start over.

Unlike the Printers Ø Configure Printer command in Printer Setup Utility, which launches a printer-specific utility for those printers that have one installed, the Configure Printer button in the CUPS Web interface provides a number of options that aren’t necessarily available from within Printer Setup Utility. For example, for my Samsung laser printer, there’s an additional Banners option that lets me choose starting and ending banners—such as Confidential, Classified, etc.—to be printed on pages immediately before and after each print job. You can even control the output resolution of some printers from this screen.

Tip

One other nice feature of the CUPS Web interface—when it works—is the Print Test Page button, available for any printer on the Manage Printers page and on each printer’s own configuration page (accessible by clicking the printer icon or printer name). The test page features a gradient sample and color wheel and is helpful for checking color accuracy and toner levels. It’s also a useful troubleshooting tool if you’re having trouble printing from within a particular application: If the test page prints, you know your printer is connected and working, and the problem is most likely with the application. (Unfortunately, the test page doesn’t work at all for some people; so if it doesn’t print, that doesn’t necessarily mean your printer is broken.) This option is also sometimes available from within Printer Setup Utility, via Printers ØPrint Test Page.

Deleting Printers via the CUPS Web Interface

To delete a printer/print queue from the Web interface, access the Manage Printers screen (click Manage Printers from the main page or from the Administration Tasks page). Find the printer you want to delete, and click the Delete Printer button. (You can also click the printer’s name or icon to go to the printer’s own page and then delete it from there.) You’ll be asked if you’re sure; click Continue.

Warning

Unlike deleting a printer in Printer Setup Utility, the CUPS Web interface will not warn you if there are pending print jobs in the printer queue. The printer will be deleted immediately, along with any and all queued jobs.

Creating Printer Classes via the CUPS Web Interface

I mentioned printer classes earlier in this chapter when I talked about creating printer pools in Printer Setup Utility; pools and classes are simply different names for the same thing, and the CUPS Web interface allows you to create these pools/classes, as well.

Once you’ve set up the printers to be included in the class (using Printer Setup Utility or the CUPS Web interface), you can create the class via the Web interface using these steps:

  1. From the main CUPS Web interface, click Add Class (or click Manage Classes, and then click Add Class on the resulting page).

  2. Just as you would a new printer/print queue, provide a name, location, and description of the new class (which is really just a new queue). The name of the queue can contain only letters, numbers, and the underscore character.

  3. On the next page, “Members for ClassName,” select the members (printers) you’d like to include in the printer class. (Holding down the command key as you click will allow you to select multiple printers. Note that if you’ve previously created other printer classes, they’ll also be listed—you can actually include classes within other classes.) Click Continue.

The new printer class queue has been created. In fact, if you open Printer Setup Utility, you’ll see it listed as an available printer. It will also show up as an available “printer” in all Print dialogs. (The caveats and features I mentioned when discussing printer pools earlier in the chapter apply to classes created here, as well.)

Managing Print Queues via the CUPS Web Interface

The CUPS Web interface gives you similar control over print queues as Printer Setup Utility; however, it also provides one extra feature: the ability to reject new print jobs without affecting jobs already queued.

Stopping/Starting Print Queues

By clicking Manage Printers on the main CUPS Web page, you’re taken to a list of all printer queues. Clicking the Stop Printer button for any printer will stop the corresponding print queue, and all pending jobs will be held. The Stop Printer button will change to read “Start Printer,” and the icon for the printer will change to reflect the fact that the printer isn’t currently active (Figure 12.4). You can of course start the printer again by clicking Start Printer. (You can also access the Start/Stop Printer buttons from the printer’s own page, which I talk about below.)

Click To expand
Figure 12.4: Active (top) and stopped (bottom) printers in the CUPS Web interface
Rejecting/Accepting New Print Jobs

Immediately to the right of the Stop/Start Printer button is the Reject Jobs button. This feature, unique to the Web interface, allows print jobs that are already in that printer’s queue to print but prevents any new jobs from being printed to it. Users will see the “stopped” symbol (the gray exclamation point) next to the printer in Print dialogs as if the printer has been stopped, but existing jobs will still be allowed to proceed.

Managing Pending Print Jobs

There are two ways to manage jobs via the Web interface. To view just the jobs for a particular printer, go to the Manage Printers screen, and then click the name or icon for a particular printer. You’ll see a list of all pending jobs for that printer. If you want to view all jobs pending for all printers, click Manage Jobs on the main Web interface page. You’ll see a similar list of pending jobs, but this one includes all printers (on either screen, you can tell which printer a job will be printed to by looking at the ID column).

Note

Keep in mind that you’ll only see jobs if there are currently jobs waiting to be printed; if you don’t print many documents at once, you’ll rarely see a long queue of print jobs. If you’re really curious, stop a printer queue and then print several documents to that printer; you’ll then be able to “Manage Jobs.” (When you’re done, you can just delete the jobs without printing them.)

Whether you’re looking at all jobs, or just those for a specific printer, the information presented for each job is the same. The ID column provides a job ID used by the printing system to keep track of the job. The Name column tells you the name of the document. The User column tells you the username of the person who printed the document. The size column provides the size of the job (in kilobytes, not pages). The State column tells you the current status of the job; if it’s been waiting, the column will tell you when it was initially “printed” by the user.

The Control column provides you with the same controls as the Show Jobs window of Printer Setup Utility. The Cancel Job button deletes a print job from the queue. The Hold Job button keeps the job in the queue but allows other jobs to print ahead of it; it won’t be printed until you resume it.

Viewing Logs of Completed Print Jobs

Another feature unique to the Web interface is the completed jobs log. The Show Completed Jobs button is located on both the printer-specific and master Manage Jobs screens. Clicking it shows you a history of jobs printed. (If you click Show Completed Jobs from a particular printer’s job screen, you’ll see a history of jobs printed by that printer; if you click it from the overall jobs screen, the list will include jobs printed by all printers.) The info is similar to that on the pending jobs screen—job ID, document name, user, size, and state. This information is culled from the file /private/var/log/cups/page_log; you can actually edit the CUPS configuration file to control how many jobs are logged (see the next section).

The Completed Jobs screen also includes a Restart Job button next to each job; however, unless you manually enable the Preserve Job Files setting in the CUPS configuration file (as described below), clicking this button will simply give you an error.

Editing/Enabling CUPS Options
User Level | admin
Affects | computer
Terminal | no

The CUPS configuration file is located at /private/etc/cups/cupsd.conf and contains most of the settings for the CUPS Web interface and server. Although any user can open the cupsd.conf file (in a text editor) to view it, it can be edited only with root access (which means that to make changes you’ll have to run a text editor as root as described in Chapter 1). Here are a few settings you may be interested in.

Note

Some OS X system updates replace your CUPS configuration file with an updated version, so if you make changes to it, you may have to re-add those changes to the new cupsd.conf file after the update.

#PreserveJobHistory Yes Whether or not the Completed Jobs log is enabled; the default is Yes.

#PreserveJobFiles No Whether or not actual print jobs are saved; the default is No. If you set this to Yes, clicking the Restart Job button on Completed Job screens will actually allow you to reprint an old print job. However, if you enable this feature, you definitely want to reduce the number of jobs logged (see the next setting) because CUPS will store a complete copy of every print job— which can eat up quite a bit of hard drive space.

#MaxJobs 500 The maximum number of recent print jobs logged by CUPS; the default is 500. If you change it to 0, there will be no limit. To disable logging, instead use the PreserveJobHistory setting (above).

To change any of these settings, open the cupsd.conf file (as root) in a text editor. First find the line that contains the setting you want to change and remove the # symbol from the beginning of the line. (The # symbol tells CUPS to ignore that setting and use the default; removing the # tells CUPS to pay attention to the line.) Then enter the new value (Yes, No, or the appropriate number), and save the file. You’ll need to restart your Mac for the settings to be applied because CUPS loads its configuration file at startup.

There are actually many, many more settings in the cupsd.conf file that you can edit. Many are easy to figure out (especially using the instructions that are included right in the file), but others are intended mainly for IT types. I encourage you to skim through the file to see what a server configuration file looks like. You can even experiment with various settings.

Warning

As with any important system file, be sure to make a backup copy of the cupsd.conf file before making any changes. If something goes wrong, you can always replace the edited version with the original.

Setting Up Printers in Classic

User Level | any
Affects | depends on Classic preferences
Terminal | no

I discussed the Classic environment in Chapter 9; however, I didn’t talk about printing in Classic. For good or bad, Classic doesn’t use OS X’s printing technologies and thus doesn’t use the printer(s) you’ve set up in Printer Setup Utility or the CUPS interface. In fact, printing is one of the areas where Classic behaves just like a Mac running OS 9. In order to print from Classic applications, you need to set up your printers within Classic; once you do so, you can print from within Classic even if you’ve never set up a printer in OS X itself.

To print in Classic, you need to first make sure your printer has drivers available for OS 9—if it doesn’t, you’re pretty much out of luck. If it does, you need to install them in the Classic System Folder. For PostScript printers, you can generally use any PPD file via OS 9’s built-in LaserWriter 8 driver. (For ease of use, drag a copy of the PPD file to /Classic System Folder/Extensions/Printer Descriptions.) For other printers, if the drivers can be manually installed via drag-and-drop, you can actually do so when booted from OS X. In addition, some Classic printer driver installers will run in the Classic environment. However, some of these installers will only run on a computer actually running OS 9, so you may need to reboot into OS 9 to install.

If you find yourself in the rare situation where (1) your printer’s drivers can only be installed using an installer, and (2) the installer will only run when booted into OS 9, and (3) your Mac is one of the newer models that won’t boot into OS 9, then things are a bit trickier. You’ll need to find a Mac that will boot into OS 9, install the drivers there, keep track of exactly what is installed and where, and then manually copy those files over to your Classic System Folder.

Note

In addition to installing Classic drivers for your printer, printing in Classic requires that the PrintMonitor application be installed in the Classic System Folder’s Extensions folder. This shouldn’t be a problem since it’s installed there by OS 9 by default; however, if you’ve moved it elsewhere manually, you won’t be able to print in Classic. Similarly, for a user to be able to print from within Classic, they need to be able to access PrintMonitor; if you’ve used the Limitations tab of Accounts preferences to “manage” a user’s access to applications, you need to add PrintMonitor to the list of allowed applications.

Once you’ve installed the OS 9 drivers for your printer, start the Classic environment and then open the Chooser utility (either by choosing it from the Apple Menu sub-menu of the Classic status menu, by navigating to /Classic System Folder/Apple Menu Items/Chooser, or by switching to a Classic application and then choosing Apple Menu Ø Chooser). Set up your printer using the instructions provided with your printer, and then close the Chooser.

Tip

If you’ve enabled “Use preferences from home folder” in Classic preferences, each user will have to set up the printer in Classic on their own (although you’ll only have to install the Classic printer drivers once). If you don’t have this checked, you’ll only have to select a Classic printer in the Chooser once, as all users will share the same printer preferences.

Once you’ve up your printer in Classic, you can print from within any Classic application.

Using Classic to Print to Unsupported Printers

User Level | any
Affects | individual user
Terminal | no

If you have a printer that is supported in Classic, but is not supported in OS X (even using open-source printer drivers, as discussed in “Supporting Unsupported Printers”), you can take advantage of Classic to print. As I’ll show you a bit later in the chapter, OS X allows you to “print” to a PDF file—in other words, to create a PDF file of the current document—from within any application. You can then open the resulting PDF file in the Classic version of Acrobat Reader (usually installed with OS 9—if not, you can download it from the Adobe website at http://www.adobe.com/products/acrobat/readstep.html) and then print from there. I actually know users who only use Classic because their older printers aren’t supported in OS X, and Classic is the only way they can print documents.

Cleaning House: Removing Unnecessary Printer Drivers

User Level | admin
Affects | computer
Terminal | no

Although OS X includes drivers and PPD files for hundreds of printers, if you’re like most people, you only use one or two. You can actually delete the support files for other printers and save quite a bit of hard drive space—400MB or more! To delete extra drivers, navigate to /Library/Printers and follow these steps:

  1. Manually delete the folders for printer manufacturers (Canon, Epson, HP, Lexmark, etc.) except for the manufacturer of your printer. Don’t delete the PPD Plugins or PPDs folders. Note that if you see a SmithMicro or PageSender folder, it contains third-party fax software, so you may not want to delete it. Similarly, you shouldn’t delete the DAVE folder, if present, as it contains support files for the DAVE Windows file sharing, networking, and printing package.

  2. Open the PPDs folder and navigate to PPDs/Contents/Resources. If you’re only using U.S. English support in OS X, you can delete all but the en.lproj folder. If you’re using other language support, you should keep the en.lproj folder plus the folder that corresponds to the language you use (fr.lproj for French, it.lproj for Italian, etc.).

Note

Although deleting extra printer drivers will free up some disk space, if you’ve got a big hard drive with lots of free space, there’s really no reason to do so—having extra drivers won’t hurt anything, and if you ever get a new printer, you’ll probably end up having to reinstall the correct drivers. In addition, if you use a PowerBook or iBook, having all of these drivers installed may turn out to be useful if you ever need to connect to a different printer while you’re on the road.


Supporting Unsupported Printers

I mentioned at the beginning of this chapter that OS X provides built-in support for a large number of printers. However, the truth is that there are a lot of other printers out there—some old, some new, some that were extremely popular, and even some that were touted as being “Mac-compatible”—that aren’t officially supported under OS X 10.2 and later. If your printer is one of them, don’t give up and buy a new printer just yet: you may be able to add support for it on your own.

One of the advantages of Apple’s decision to use CUPS as its core printing technology is that as an open-source system, CUPS is easily extensible. In addition, because of the popularity of Unix among techies, there’s a talented pool of programmers who spend their time (often without compensation) working on open-source projects. The end result is that there are developers all over the world who are writing printer drivers for Unix computers that use CUPS. By using these drivers, you gain support for hundreds of additional printers: older inkjet printers, LocalTalk printers, QuickDraw printers, PostScript Level 1 printers, large-format printers, dot-matrix printers, and even many new, “Windows-only” printers. In addition, even some printers that are officially supported in OS X are better supported through open-source drivers. For example, many Epson printers support borderless printing, but some of the official Epson drivers don’t allow it while the open-source drivers do.

The two main sources for CUPS-compatible printer drivers are the Gimp-Print Project (http://gimp-print.sourceforge.net/MacOSX.php3) and LinuxPrinting.org (http://www.linuxprinting.org/macosx/). Gimp-Print drivers are actually installed by default under Mac OS X 10.3 and later; for OS X 10.2, you can download them as a single installer package. In either case, they provide support for more than 300 printers (mostly inkjet but also many laser printers). The LinuxPrinting.org drivers are provided in smaller packages based on printer brand/type: Brother, Hewlett-Packard, Apple Image- Writer, PostScript Level 1, and Samsung. You can see the complete lists of printers supported by each at http://gimp-print.sourceforge.net/p_Supported_Printers.php3 and http://www.linuxprinting.org/database.html, respectively. The Gimp-Print page even shows the degree of current support for each printer: fully operational, operational, needs testing, or untested. What’s more, since many printers work well with drivers for closely related models, even if your printer isn’t listed, it’s worth trying the driver for a similar printer before you go out and buy a new one. (If a particular printer model isn’t listed, you can also submit a request for a driver; there’s no guarantee, but there’s a good chance someone will try to help you out.)

Tip

You’ll notice that the lists of printers supported by Gimp-Print and the LinuxPrinting.org drivers include many “Windows-only” printers. In case you’re wondering, the answer is yes: by using these open-source drivers, many Windows-only printers are instantly usable on your Mac!

In the sections that follow, I’ll show you how to install and use the Gimp-Print driver package. Although I’m prevented by space constraints from doing the same for the various LinuxPrinting.org packages, rest assured that they work in much the same way and include detailed documentation to guide you through the process.

Installing and Using Gimp-Print Drivers

User Level | admin
Affects | computer
Terminal | no

If your printer is listed as being supported by the Gimp-Print package, you’re a free download away from being able to print again. Although installing and using the Gimp-Print drivers is fairly straightforward, there are a couple places where it’s easy to get tripped up.

Note

As I mentioned earlier, the Gimp-Print drivers are installed by default with Mac OS X 10.3 and later. If you’re running OS X 10.3 or later, you only need to follow the installation instructions here if you’re installing a newer set of Gimp-Print drivers than those that came with OS X. (Newer drivers are occasionally posted on the Gimp-Print project website.) Otherwise, you can skip ahead to “Setting Up Printers Using Gimp-Print Drivers.”

Note

In case you’re wondering where the Gimp-Print project got its name, it’s because it began as a printer plug-in for the Unix graphics application The GIMP.

Installing the Gimp-Print Package

Installing the Gimp-Print package actually involves two steps. The first is installing the drivers themselves. The second is installing a package called ESP Ghostscript. Some applications, such as Adobe Illustrator and Photoshop, and even Apple’s own AppleWorks, generate their own PostScript code. This causes problems for the Gimp-Print drivers, so a third-party PostScript interpreter is needed as a go- between. ESP Ghostscript, another free, open-source product, fills this need. In fact, once you install it, it operates invisibly and you never even know it’s there. Here’s how to install both:

  1. Download the Gimp-Print package from http://gimp-print.sourceforge.net/MacOSX.php3. You’ll see several download options; I recommend the one that says "newest final release" (as opposed to the one that says "newest pre-release," which means it’s still in testing). From the same page, download the ESP Ghostscript package, as well. Both downloads will be in the format of OS X disk images.

  2. Mount both disk images in the Finder by double-clicking them.

  3. If your printer connects to your Mac via a USB cable, make sure it’s connected and turned on.

  4. Open the Gimp-Print image and double-click the Gimp-Print installer package (it should be called something like Gimp-Print 4.x.x.pkg). Provide your admin username and password, and then follow the on-screen instructions. Exit the installer when finished.

  5. Open the ESP Ghostscript image and double-click the ESP Ghostscript.mpkg package. Follow the same procedure as in Step 4.

  6. Restart your Mac.

You’ve just added support for a few hundred additional printers. The next step is to set up your printer(s).

Setting Up Printers Using Gimp-Print Drivers

Because the Gimp-Print drivers are fully CUPS-compatible, you could use the CUPS Web interface to set up your printer. However, I find that Printer Setup Utility is much easier for such simple tasks. The only tricky part is that you may have to access Printer Setup Utility’s “Advanced” options screen.

Setting Up a Locally Connected (USB) Printer

To set up a USB printer connected directly to your Mac:

  1. Launch Printer Setup Utility (in /Applications/Utilities).

  2. Hold down the option key and click the Add button in the Printer Setup Utility toolbar. (The option key enables access to the Advanced setup options.)

  3. Click the pop-up menu at the top of the window, and choose Advanced.

  4. Click the Device pop-up menu; your printer should appear at the bottom of the menu. (If it doesn’t, double-check to make sure your printer is connected and turned on.) Choose it from the menu.

  5. If desired, change the Device Name to something more exciting or meaningful. (But don’t change the Device URI—that’s how your Mac keeps track of the printer.)

  6. Click the Printer Model pop-up menu, and choose the printer name or model number. If you select a manufacturer (Canon, Epson, HP, etc.), a list of models will appear; select the appropriate model, if applicable. You’ll notice that many of these drivers include the text “Gimp-Print” in their names; these are the Gimp-Print drivers. If your printer isn’t listed but you have a PPD file for it, select the Other… option and navigate to the PPD file in the resulting file browser (the PPD file must be located on your hard drive).

  7. Click Add to add the printer.

Tip

Some AppleTalk printers—and LocalTalk printers connected via a LocalTalk-to-Ethernet adapter—are also supported by Gimp-Print. Simply follow the instructions provided for setting up a USB printer; your printer should show up in the Device pop-up menu (Step 4) just like a USB printer would.

Setting Up a Printer Connected via TCP/IP

If your printer (or, in the case of many business environments, print server) isn’t connected directly to your Mac but is available via TCP/IP (a network connection), you need to set up an IP printing queue rather than a local printing queue. You should get the IP address and queue name of the printer or print server from your network administrator, then perform the following steps.

  1. Click Add in the Printer Setup Utility toolbar.

  2. Click the pop-up menu in the resulting window and choose IP Printing.

  3. Choose the appropriate setting from the Printer Type pop-up (Rendezvous for locally networked printers, or LPD/LPR, Internet Printing Protocol, or Socket/HP Jet Direct).

  4. In the Printer Address field, enter the IP address of the printer or print server (or the domain name if it has one), and enter the name of the print queue in the Queue Name field.

  5. Click the Printer Model pop-up menu, and choose the name or model number of the printer (or, as above, if you have a specific PPD file for the printer, select Other… and navigate to it). If necessary, choose the specific model number from the Model Name list.

  6. Click Add to add the printer.

  7. If you want to change the name of your newly added printer, select it in the Printer Setup Utility window and then choose Printers Ø Show Info. From the pop-up menu, select Name & Location, and enter your preferred name in the Printer Name field. You can also add a more meaningful location in the Location field.

Setting Up a Shared Windows Printer

To add a printer being shared by a Windows computer, follow the same steps listed under “Using Printer Setup Utility” earlier in the chapter; if you’ve just installed the Gimp-Print drivers for the first time, the difference is that now you’ll have a whole lot more printer drivers from which to choose.

Using Gimp-Print–Supported Printers

As I mentioned earlier, once you’ve set up a printer using the Gimp-Print drivers, it functions much like any other printer. You can set it as your default printer in Printer Setup Utility or the CUPS Web interface, or you can select it for any individual print job using the OS X Print dialog. The one area where Gimp-Print drivers differ is in accessing special printer features. Many manufacturer-provided printer drivers alter the main Print dialog itself to provide additional printer features. However, additional options provided by Gimp-Print drivers are available via a new Printer Features panel, accessible from the options pop-up menu in Print dialogs.

The only caveat to using Gimp-Print (and other open-source) drivers is that you need to remember they don’t come from the printer manufacturer. In most cases they work like a charm; however, sometimes they don’t, and the printer manufacturer—which evidently doesn’t support the printer fully to begin with— probably won’t help you with any problems you might have. Be sure to check out the driver rating (provided on the websites listed earlier) to see if all of your printer’s features are supported. However, it’s important to keep some perspective: For many printers, open-source drivers are the only solution. In addition, the open-source community is generally responsive to requests for help and bug reports. Be sure to check out the forum and feedback links on the Gimp-Print and LinuxPrinting.org websites.


Sharing Your Printer

User Level | admin
Affects | computer
Terminal | no

I covered most of the items in the Sharing pane of System Preferences in Chapters 9 and 10. However, one that I didn’t cover was Printer Sharing. If you have several Macs on a local network, Printer Sharing—which works seamlessly with OS X’s Rendezvous technology—is actually quite amazing. When Printer Sharing is enabled on your Mac, any print queue that has been set up for a printer connected to your Mac (either via Printer Setup Utility or using the CUPS Web interface) will be shared with other computers on your local network running OS X. Other Macs will be able to see and print to the printers as if they were actually connected to those Macs, generally without requiring any setup or configuration. Even better, Printer Sharing doesn’t work just with those printers that are officially supported by OS X; it works with any printers you’ve managed to successfully set up. For example, if you’re using Gimp-Print drivers to add support for an “unsupported” printer, that printer will also be available to other Macs on your network. (The only caveat being that connected computers need to have the appropriate printer drivers installed, as well.) And unlike Mac OS 9’s similar functionality, USB Printer Sharing, Printer Sharing in OS X works for any printer connected via USB, Ethernet, wireless (AirPort), and even FireWire.

Enabling Printer Sharing is as simple as opening Sharing preferences and checking the box next to Printer Sharing. (You can also open the Print & Fax pane of System Preferences and check the box next to “Share my printers with other computers.”) Other Macs on your network don’t need to do a thing (unless they’re running OS X 10.2, in which case they simply need to check “Show printers connected to other computers” in Print Center preferences). Printers shared by your Mac will automatically be set up for them. After that they can print to your shared printer as if it was connected to their own computer.

The main drawback to Printer Sharing is that, just like Internet Sharing, if you’re sharing a connected printer with other computers on your local network, your Mac will need to be on and awake for those computers to be able to print to the shared printer. So you should connect your printer(s) to the Mac that tends to be running most often.

Start Sidebar
Your Mac’s Rendezvous Name and Printer Sharing

Printer Sharing works with Rendezvous to provide printing services to other local computers. This means that when you share a printer, other local Macs set up a queue for that printer using your Mac’s Rendezvous name (set up in Sharing preferences) as part of the printer’s address. If you change your Rendezvous name, Macs connected to your printer can get confused since the printer is no longer “where” it was before; any print jobs sent from those Macs to a printer shared by your Mac will fail. To fix this problem if it occurs, other computers will need to delete the shared printer from Printer Setup Utility and use the new one that should automatically appear.

More seriously, if you change your Rendezvous name while Printer Sharing is enabled, the following preference files may become corrupted on computers connected to your Mac’s printer(s):

  • com.apple.print.custompresets.plist

  • com.apple.print.PrintCenter.plist (if it exists)

  • com.apple.print.PrinterSetupUtility.plist (if it exists)

  • com.apple.print.defaultpapersize.plist (OS X 10.2)

  • com.apple.print.PrintingPrefs.plist (OS X 10.3)

If this happens, users of those computers may need to delete these preference files from ~/Library/Preferences before they can print again. If you want to change your Rendezvous name, you can avoid this problem by disabling Printer Sharing before changing the name and then enabling Printer Sharing again afterward. (Other Macs may have to re-select the shared printer(s) in Printer Setup Utility.)

End Sidebar
Note

Enabling Printer Sharing also shares any fax “printers” you’ve created, as described later in this chapter under “Fax Functionality.”

Note

Some OS X system updates replace your CUPS configuration file (/etc/cups/cupsd.conf) with an updated version. The newer version usually has Printer Sharing disabled. This means that if you use Printer Sharing, you’ll often have to re-enable it after updating OS X.

Sharing Printers with Windows Computers

If you enable Printer Sharing and Windows File Sharing in Sharing preferences, Windows computers on your local network will also be able to access your shared printers. However, instead of using Windows’ Add Printer Wizard, Windows users should go to Network Neighborhood and locate your computer. If they open your computer’s icon, any printers being shared by your Mac should be visible. They can right-click one of them and select Install to print to it (although they’ll need the appropriate driver installed on their Windows computer).

Sharing Printers over the Internet

If you’d like to—or would like someone else to—be able to print to a shared printer from elsewhere on the Internet (or from a different subnet of the same network), you can do so using Internet Protocol Printing (IPP). Here’s how:

  1. From your Mac (the one sharing the printer), open the CUPS Web interface in your browser. Go to Manage Printers, and then click the printer you want to access. Note the URL in your Web browser’s address field. (For example, for my Samsung laser printer, the address is http://127.0.0.1:631/printers/ML_1210.)

  2. From the other Mac (the one you want to use to print to your shared printer), launch Printer Setup Utility and access the Advanced Add Printer dialog (hold down the option key and click the Add toolbar item, and then choose Advanced from the pop-up menu).

  3. In the Advanced dialog choose “Internet Printing Protocol using HTTP” from the Device pop-up menu. Enter a name for the printer in the Device Name field, and then enter the address of the printer in the Device URI field. However, in the address you noted above, replace 127.0.0.1 with the actual IP address of the computer sharing the printer (e.g., the address should look like http://ipaddress:631/printers/printer). Then select the correct printer brand and model in the Printer Model section. Click Add to add the printer.

Assuming that both computers are connected to the Internet, you should be able to print to the shared printer over the Internet by simply selecting the new printer in Print dialogs.

Note

If the computer sharing the printer is behind a firewall and/or router, remember the caveats I explained in Chapter 10 about IP addresses.

Sharing Printers with Macs Running OS 9

Normally, Macs booted into OS 9 will not be able to access a printer shared by a Mac running OS X. However, you can enable USB Printer Sharing in the Classic environment, which will allow OS 9 computers to print to a USB printer connected to an OS X computer.

The problem is that, according to Apple, you shouldn’t have Printer Sharing in OS X and USB Printer Sharing in the Classic environment enabled at the same time. For more details, see http://docs.info.apple.com/article.html?artnum=107060.

Note

You may be able to access a shared PostScript printer from OS 9 via LPD (an IP-based printing protocol). For details see http://www.macosxhints.com/article.php?story=20020901005320524.


Printing Pointers

If you’ve ever printed a document on a Mac, you know that the process is pretty straightforward. Once you’ve got a printer set up, you choose File Ø Print (or press command+P) from within any application, and you’re presented with the standard Print dialog. If you have more than one printer, you can choose the printer to which you want the document to print from the Printer pop-up menu. If you have any saved printing presets (I’ll talk about those in a bit), you can choose one from the Presets pop-up. Finally, you can customize the settings for each print job by clicking the printing options pop-up menu and browsing the options panels. (The options pop-up menu is the one that isn’t labeled, but its default is “Copies & Pages.”) When you’re ready to print, you click Print.

However, a number of other options are available to you, both from within the Print dialog and via third-party software. Here are a few of the best tips for printing in OS X.

Tip

When you access the Printer pop-up menu in any Print dialog, if you hold the mouse over a printer name for a few seconds, a “tooltip” box will appear that shows you the Location and Host information for that printer.

Note

A tip not included here is how to print the contents of Finder windows; I covered that back in Chapter 5.

Using Desktop Printers

User Level | any
Affects | individual user
Terminal | no

In OS 9, setting up a printer in the Chooser also set up a Desktop Printer—an icon of that printer on the Desktop. If you dragged a document onto that Desktop Printer, the document would be printed; if you double-clicked the Desktop Printer, you could view and manage its print queue.

Under OS X 10.3 and later, Apple has provided similar Desktop Printer functionality. However, unlike OS 9, in OS X you need to manually create Desktop Printers by opening Printer Setup Utility, selecting the desired printer, and then choosing Printers Ø Create Desktop Printer… A dialog will appear asking you where to place the Desktop Printer—oddly enough, “Desktop Printers” don’t need to reside on the Desktop—and what to name it. Click Save to create the Desktop Printer, and it will appear in the Finder. You can actually create multiple Desktop Printers, in different locations, for the same printer.

Note

I mentioned earlier in this chapter that each printer queue is actually an application in ~/Library/Printers. Desktop Printers are really just aliases to those printer queue applications. This means that you can also "create" a Desktop Printer manually by making an alias of a printer queue application and placing the alias wherever you like. The downside to Desktop Printers simply being aliases is that if you delete a printer in Printer Setup Utility, any Desktop Printers you’ve created for that printer aren’t deleted; you’ll need to delete them manually.

Once you’ve got a Desktop Printer set up, you can print a document by dragging it onto the Desk- top Printer icon. What you’re doing is sending it directly to the print queue for that printer, bypassing the Print dialog (your default settings will be used). In the case of PDF, PostScript, and ASCII text files, the file will be printed immediately, without the need to open any application. For other types of documents, if the application you’d normally use to print the document is already open, the document will be printed immediately; if it isn’t open, it will launch. Either way, you avoid having to open the document and walk through the printing process.

Alternatively, if you’ve already launched the printer queue application so that you’re viewing the job list, you can drag a document directly into the job list window to add it to the queue.

Tip

You can also print a document by dragging it onto the Printer Setup Utility icon in the Finder or Dock; the document will automatically be printed using your default printer. In addition, if you control/right-click a document in the Finder and choose a Desktop Printer, or Printer Setup Utility itself, from the Open With sub-menu of the resulting contextual menu, the document will be printed immediately.

Note that a few applications that don’t support “direct printing” (printing without user input) will still display the Print dialog before printing; unfortunately, there’s no way around this.

Desktop Printers in OS X 10.2

If you’re running OS X 10.2, opening a printer in Print Center provides virtually identical functionality to Desktop Printing in terms of access to printing queues (including dragging documents into the job list). However, you don’t get the same degree of drag-and-drop printing functionality. Here are two ways to get some of it without upgrading your operating system.

Printing Directly to Print Center

If you open Print Center, you can drag any document onto a printer/print queue in the Print Center window; itwill be added to the queue and printed, using that printer’s default settings. Alternatively, if you’re viewing an individual print queue via its Show Jobs window, you can drag a document directly into the window to add it to the queue. Finally, you can even drag a document onto the Print Center icon in the Finder or Dock, and it will automatically be printed using your default printer.

Printing Using DropPrint

If you’d like something that works as closely as possible as OS 9’s Desktop Printing, consider the shareware DropPrint (http://seiryu.home.comcast.net/dropprint.html). If you drag a file onto the DropPrint icon (in the Finder or the Dock), it will be printed immediately; in this respect it works much like Desktop Printing. However, DropPrint also provides a number of other nice features. My favorite is that you can print OS X text clippings without having to first drag the clippings into another application. DropPrint can also send PostScript files (such as those created using the procedure explained earlier in the chapter) directly to PostScript printers via TCP/IP or AppleTalk without having to set up any printers on your Mac. DropPrint also has its own Quick Print Text window into which you can drag clippings or paste the contents of the clipboard and print without using any other application. Finally, in applications that support Services, you can select text and then choose ApplicationName Ø Services Ø Print This Text to print only the selected text, instead of the entire document.

An Alternative to Desktop Printers: Print Documents CM

One of the big draws to Desktop Printers is the ability to quickly print a document to a particular printer without having to open the document, choose a printer, etc. If this functionality appeals to you but you want an even quicker way to do it, check out the shareware contextual menu plug-in Print Documents CM (http://www.naratt.com/PrintDocuments.html). Once installed, it works just like the Finder’s Open With contextual menu item—control/right-click a document in the Finder to access it—except that instead of selecting an application with which to open a document, you select a printer with which to print it. All printers listed in Printer Setup Utility appear in the contextual menu, even if you haven’t set up Desktop Printers for them. I find Print Documents CM to be more convenient than Desktop Printers, plus I don’t clutter up my Desktop with Desktop Printer icons.

Using Quartz Filters

User Level | any
Affects | individual user
Terminal | no

Mac OS X 10.3 takes advantage of OS X’s Quartz graphics engine to allow you to apply Quartz Filters to print jobs. A Quartz Filter is a filter that you can apply to a document to customize how that document appears when “printed.” You can create and modify Quartz Filters using ColorSync Utility (in /Applications/Utilities), but Apple has provided a few useful Filters right out of the box: Black & White, Blue Tone, Gray Tone, Lightness Decrease, Lightness Increase, Reduce File Size, and Sepia Tone. You can also edit these Filters or create your own.

You can use these Filters when you print in order to alter the appearance of printouts. When the Print dialog appears, choose ColorSync from the options pop-up menu. From the Quartz Filter popup menu that appears, choose a Filter, and then click Print to print the document using that filter.

If you’re not sure which filter you want to use, choose Add Filter… from the Quartz Filter menu—your document will be shown in a preview window from within ColorSync Utility. (Check the Preview box at the top of the window to enable the preview.) You can select any stock Filter, or any Filter you’ve created in ColorSync utility, or you can create a new Filter and adjust its settings to your liking. (When you’re done, you’ll need to access the Print dialog again and select the desired filter before you print.)

Saving Custom Print Job Settings

User Level | any
Affects | individual user
Terminal | no

In any Print dialog, you can use the options pop-up menu—which doesn’t actually have a name, but is usually referred to as the options pop-up because it provides access to printing options—to choose settings such as the number of copies, the pages to print, page layout, output options, paper trays/ feeding, and any application-specific printing settings that may appear. If you find yourself using the same custom options frequently, you can save that set of options as a printing preset.

First, choose your settings in each of the options panels (accessible via the options pop-up menu). When you’re satisfied, click the Presets pop-up menu and choose Save As… Give the preset a name, and then click OK. The next time you print, you can choose the preset from the Presets menu, and the document will be printed using that set of custom options.

Tip

You can see a summary of the settings in a custom preset by selecting the preset and then choosing Summary from the options pop-up menu.

You can also delete and rename presets by selecting the preset you want to delete or rename and then choosing the appropriate command from the Presets menu. Finally, if you want to alter an existing preset, select that preset, make your changes from the various Options panels, and then select Save (instead of Save As…) from the Presets pop-up menu.

Tip

If you find yourself “printing” to PDF files frequently (see the next section), you can even create a printing preset with the Output Options set to “Save as File” (with PDF for the Format); to create a PDF file, simply select this preset in the Print dialog and click Save…

“Printing” to a PDF File

User Level | any
Affects | individual user
Terminal | no

Portable Document Format files, more commonly known as PDF files, can preserve a document’s fonts, graphics, and layout, and can be viewed on any platform using a free viewer such as Acrobat Reader (or, in the case of OS X, using the Preview or TextEdit applications). For these reasons, PDF has become a universal standard for document publishing and sharing. You’ve surely downloaded PDF files, or had them sent to you via e-mail.

In Mac OS 9, Windows, and other operating systems, creating a PDF file requires purchasing commercial software such as Adobe’s Acrobat. However, PDF is actually a native file format in OS X, which means that if you can print a file, you can create a PDF version of it. You can create a PDF file of a document, a Web page, or anything else you can print, and then give it to someone else and be confident that they’ll be able to view it and, perhaps more importantly, see exactly what you see.

To create a PDF of a document, open the document as if you were going to print it (using whatever application you’d normally use to open and print the file). Choose File Ø Print… (or press command+P) to access the Print dialog. However, instead of clicking the Print button, click the Save As PDF… button. Choose a location to save the file, and then click Save. Your document will be converted to a standard PDF file that you can distribute or save for posterity.

Note

If you’ve added PDF workflow items to your Print dialogs (see “Working with PDFs: PDF Workflows”), the Save As PDF… button will instead be a button that looks like a PDF document; clicking this button gives you a popup menu of choices, one of which is Save As PDF…

It’s also possible to create a PDF by clicking the Preview button in any Print dialog, which opens the Preview application with a replica of the document as it will look when printed. If you then choose File Ø Save As…, you can save the preview as a PDF (or choose File Ø Export… to save it in another graphics format). Finally, you can create a PDF of an existing graphics file by opening it in Preview and then using the File Ø Export… command to convert it to PDF.

Tip

You can use the Save As PDF feature from within your Web browser to save copies of online receipts and documents; this is a great way to cut down on paper use, plus the files will always be handy.

The main difference between OS X’s PDF files and those created by the commercial Acrobat software is that Acrobat allows you to include bookmarks, clickable URLs, and other interactive features within the PDF files it creates. However, for most documents, OS X’s simple PDF format is an adequate substitute (especially considering that it’s free).

Note that when you save a file as a PDF, it’s technically formatted for the printer you select in the Print dialog; if the resulting PDF is later printed on a different printer, there’s a possibility that it may not appear exactly the same. (For example, spacing may be slightly different.) Although such differences are generally minor, if this is a concern and you know which specific printer the document will eventually be printed on, you can try to set up a “replica” of that printer in Printer Setup Utility and then choose that printer in the Print dialog when you save to PDF.

Creating Smaller PDF Files

Although Mac OS X’s ability to create PDF files from any document is very cool, it has one drawback: The PDF files are huge. By that I mean that the PDF file size is quite a bit larger than a PDF created from the same document using an application such as Adobe Acrobat. There are a good number of third-party applications on the market that will “shrink” these PDF files to more reasonable sizes—an excellent one is PDFshrink (http://www.apago.com/pdfshrink)—but under OS X 10.3 and later you can use Quartz Filters (discussed earlier in this chapter) to significantly reduce their size right from the start. Here’s how.

Open the document, and then access the Print dialog as you normally would if you were going create a PDF file. However, don’t click the Save As PDF… button yet; instead, choose ColorSync from the options pop-up menu in the Print dialog. From the Quartz Filter pop-up menu that appears, choose Reduce File Size. Then click the Save AS PDF… button to create the PDF file.

If your document is mainly text, you won’t see a big difference between the standard and “reduced” file size. However, if it contains a lot of graphics and/or images, you should see significant space savings. For example, I created a PDF from a 58-page document that had approximately 15 grayscale images. The default size was more than 1.1MB; the “reduced” size was just over 700KB. A more extreme example: A PDF file created from a large Microsoft Word document that was over 8MB when created normally ended up being only 600k using the Quartz Filter!

Tip

In Chapter 7, I explained how to create your own Quartz Filters using ColorSync Utility. By duplicating the Reduce File Size Filter in ColorySync Utility and then experimenting with the different settings in that new Filter, you can create a Filter that reduces PDF file size even more than the stock Reduce File Size Filter.

Working with PDFs: PDF Workflow

User Level | normal or admin
Affects | individual user or computer
Terminal | no

In addition to the ability to save a document as a PDF file, OS X (version 10.2.4 and later) also allows you to process the resulting PDF file using an application, an AppleScript, a Unix application or script, or the Finder. Apple calls this functionality PDF workflow, and it adds enormous potential for working with PDFs.

Oddly enough, at the time of this writing, PDF workflow is actually hidden by default. To enable it, you need to manually create one of the following folders:

  • /Library/PDF Services

  • ~/Library/PDF Services

Once you’ve done this, the Save As PDF… button in all Print dialogs will be replaced by a button that looks like an actual PDF document. Clicking this button presents you with a pop-up menu of PDF workflow options (Figure 12.5).

Figure 12.5: The PDF workflow pop-up menu includes whatever items you’ve placed inside the PDF Services folder(s).
Tip

The donationware PDF U (http://www.ifthensoft.com/) will automatically create the PDF Services folder and, even better, populate it with some very useful AppleScripts. (The e-Mail and Open items in Figure 12.5 are actually AppleScripts provided by PDF U.)

If you haven’t placed anything inside your PDF Services folders, unlike Figure 12.5 your only option will be Save As PDF… However, items placed in your PDF Services folders—/Library for all users, ~/Library for your own account; you can place different items in each—will appear as options for creating and processing a PDF file from the current document. (You can actually place items inside /Network/Library/PDF Services, as well, and they will appear in your PDF workflow menu; however, you still need a PDF Services folder inside /Library or ~/Library in order for the menu to be activated.) Here are the kinds of items you can add to your PDF Services folder(s) and what they do when selected from the PDF workflow pop-up menu:

Folder (or alias to a folder) Creates a PDF file and save it in the chosen folder. The PDF file is named using the document title (although some applications will add the application name, as well). For example, if you use PDFs to save copies of online receipts or documents, place an alias of the folder you use to store those PDFs in your PDF Services folder. Whenever you want to save a PDF of an online document, simply select the folder name from the PDF workflow pop-up menu. The PDF will be created and automatically moved to the folder for you. (For example, if you want to save PDFs to your Desktop, place an alias to ~/Desktop inside ~/Library/PDF Services.)

Application (or alias to application) Creates a PDF file and then opens/processes it using the chosen application. For example, if you want to be able to create a PDF and then immediately open that PDF in Adobe Acrobat or another PDF-processing utility, you simply place an alias to Acrobat or the utility in one of the PDF Services folders—select it from the PDF workflow pop-up menu to create the PDF and open it in the desired application in one step.

Tip

If you place an alias of your e-mail client (Mail, Entourage, Eudora, etc.) inside your personal PDF Services folder, selecting it from the PDF workflow pop-up menu will create a PDF file of the current document and then attach it to a new outgoing e-mail message. The only drawback is that at the time of this writing, the name of the PDF attachment will simply be “Print job.” If you want a more descriptive name, you’ll need to use AppleScript.

AppleScript (or alias to an AppleScript) Processes the PDF file using the chosen AppleScript. Many publishing and graphics companies have complex AppleScript-based document processing systems. Instead of saving a PDF and then manually dropping it onto an AppleScript, you can simply select the AppleScript from the PDF workflow menu.

Unix tool (command-line application or shell script) Processes the resulting PDF file using the Unix application or shell script. Selecting a Unix tool from the PDF workflow menu creates the PDF file and then provides the Unix tool with the PDF title, the CUPS options for the print job, and the path to the spooled PDF.

Note

When selecting an application, AppleScript, or Unix tool from the PDF workflow menu, unless the application or script actually moves or saves the PDF file somewhere, it will be located in /tmp, the default location for temporary PDF files.

Once you’ve added items or aliases to the PDF Services folder(s), you can actually rename the items or aliases so that their names more clearly identify what they will do. For example, if you include an alias to a folder in which you want to store PDF files, you can rename the alias “Save to PDF Archive”; this name will appear in the PDF workflow menu instead of the actual folder name. You’ll notice in Figure 12.5 that I’ve renamed the items in my own PDF Services folder in such a manner.

For more information about the PDF workflow system, check out Apple’s own documentation at http://www.apple.com/applescript/print/ and http://developer.apple.com/techpubs/macosx/CoreTechnologies/ graphics/Printing/PDF_Workflow/pdfwf_intro/index.html.

Creating a “Virtual” PostScript Printer (a.k.a. Printing to a PostScript File)

User Level | any
Affects | individual user
Terminal | no

If you work in the graphics industry (or if you’ve ever interacted with those who do), you’ve probably encountered the concept of “virtual printers”—printers that don’t actually print but instead save a document as a PostScript file. If the virtual printer is set up to be the same printer model as the one that will eventually print the document, the resulting PostScript file can later be sent directly to the actual printer without any formatting or previewing. Doing this in OS X requires two actions: setting up the virtual printer and “printing” to that printer.

To set up your virtual printer:

  1. In Printer Setup Utility, click the Add Printer toolbar item, and then choose Internet Printing Protocol (IP Printing in OS X 10.2’s Print Center) from the Printer Type pop-up menu (not the pop-up at the very top of the dialog).

  2. Enter localhost in the Printer’s Address field.

  3. Give the queue a descriptive name (e.g., VirtualPrinter—avoid using spaces).

  4. Choose a printer manufacturer from the Printer Model pop-up and then select the appropriate model from the resulting list of printers. (If the file will eventually be printed on a specific printer, be sure to select that printer here.)

  5. Click Add to create the virtual printer.

To “print” to the printer and create a PostScript file of a document:

  1. Open the document as if you were going to print it; choose File Ø Print… (or press command+P).

  2. Select your virtual printer from the Printers pop-up menu.

  3. From the options pop-up menu, choose Output Options. Check the “Save as File” box, and choose PostScript from the Format pop-up menu.

  4. Click Save…, choose a name and location for the saved file, and then click Save.

Note

If you don’t set up a virtual printer, you can still create a PostScript file; simply follow the steps for creating a PostScript file, but choose one of your existing printers from the Printers pop-up menu. However, you must choose a PostScript printer or PostScript won’t show up as an Output Option.

Tip

It used to be that to print PostScript and EPS documents, you needed a PostScript-compatible printer or an EPS “Rip” (a kind of print server that works with EPS files). However, in OS X 10.3 and later, you can open such files in Preview and then print them directly to raster (non-PostScript) printers—OS X converts them on the fly. This means that you can use any inkjet printer as a “PostScript” printer (and, with Printer Sharing enabled, as a PostScript network printer!).


Printing Selectively

User Level | any
Affects | individual user
Terminal | no

Do you ever find yourself printing an entire Web page when all you really want is some portion of the text on that page? Or printing an entire e-mail message or Microsoft Word document only to find that you throw most of the printout away? I’d guess that this is a pretty common occurrence for most people. One solution is to copy text from the Web page or document and then paste it into a new document, but this can get quite tedious. If this is an issue for you, the shareware utilities iPrint, PrintMagic, and WebPrint Plus (all from MacEase, http://www.macease.com/) provide a novel solution.

All three of these utilities offer the ability to select just the content you want to print—including the ability to filter out Web graphics and ads from Web pages—and then print it using a key combination similar to OS X’s own (control+option+P instead of command+P). So instead of printing out a messy four-page website, you can select just the few paragraphs you want to print. This “selective printing” not only saves you the trouble of having to scour through long printouts, it also saves toner/ink, and, if you choose to filter out graphics and ads, it makes printing Web pages significantly faster.

PrintMagic and WebPrint Plus also add the ability to print text clippings and highlighted text via drag-and-drop, as well as the ability to add to date/time stamps, URL stamps, and your own notes to printouts. WebPrint Plus also adds the ability to print text using various spacings (to leave room for handwritten comments). It also lets you edit the content of your printout on the fly via a builtin text editor.


Fax Functionality

User Level | admin to set up, any to use
Affects | computer or individual user
Terminal | no

For years, Apple included third-party fax software with new Macs for sending and receiving faxes. Unfortunately, many users found these third-party solutions to be, well, let’s just say “not the most reliable and trouble-free software on the market.” In OS X 10.3, Apple again took advantage of Mac OS X’s Unix roots by implementing the Unix fax software efax and sticking an OS X interface on top of it. If you don’t need a lot of advanced features, OS X’s built-in fax functionality should be sufficient. All you need is a standard phone line—or even a wireless phone, if your phone plan supports data transmission—connected to your Mac.

Note

If you connect to the Internet via a dial-up (modem) connection, and use the same phone line for faxing, you can’t access the Internet and fax at the same time. You need to disconnect from your Internet connection before you can fax. After the fax has been sent, you can reconnect to your ISP.

Tip

Unfortunately, I didn’t have enough room in this chapter to include all of the fax-related tips I wanted to share. I’ve put some of the ones that wouldn’t fit up on the book’s website (http://www.macosxpowertools.com/).

Print & Fax System Preferences, Part 2: Faxing

I promised I’d talk about the rest of the Print & Fax pane of System Preferences later in this chapter; here we are. Oddly enough, the Faxing tab of Print & Fax preferences relates mainly to receiving faxes. Checking the “Receive faxes on this computer” box tells your Mac to automatically answer the phone line connected to it and, if applicable, receive any incoming faxes. The “When a Fax Arrives” options let you decide how many rings your Mac should wait before answering and what should happen to faxes once they’re received. (I’ll talk more about these receiving options in “Receiving Faxes,” below.)

The one option in Print & Fax preferences that relates to sending faxes is the My Fax Number field. The text you type here will be printed at the top of each outgoing fax, ostensibly to allow the recipient of your fax to identify where it came from and, if necessary, fax something back to you later. However, it doesn’t actually have to be your number; for example, if you’re faxing a work document from home, you can provide your work fax number instead. The field isn’t even limited to numbers—you can type your name and fax number so that both appear on your outgoing faxes.

Unlike most of the settings in the Printing tab of Print & Fax preferences, those in the Faxing tab affect the entire computer and as such require administrative access to change.

Note

If you’re wondering why Apple has grouped printing and faxing together, it’s for two reasons. First, faxing and printing are inextricably linked—when you fax in OS X 10.3 and later, you’re actually sending a print job to a printer queue. It’s just that the “printer” is a modem, and the fax software sends the print job over the phone line. Second, as I’ll explain in a bit, from a practical standpoint the two go together well, as the procedure for faxing in OS X is almost the same as that for printing.

Sending Faxes

Faxing in Mac OS X (10.3 and later, of course) is really quite simple, if a bit unintuitive at first. When you’re ready to fax a document, you access the File menu from within the application in which the document is open and then choose the obvious command—Print. (Yes, I was being facetious there.) In the resulting Print dialog, click the Fax… button.

Note

The first time you ever click the Fax… button in a Print dialog, you’ll see a progress dialog that says “Creating Printer…” What’s happening is that, as I mentioned earlier, Mac OS X is automatically creating a printer queue (or “fax queue,” if you prefer) for each modem connected to your computer. This will generally be a queue called Internal Modem, but it could also be USB Modem, Bluetooth-Modem, or several of the above, depending on your setup.

You’ll then see OS X’s fax dialog (Figure 12.6). To add a recipient, you can either type the recipient’s fax number in the To field or click the Address Book button (to the right of the To field—it looks like the silhouette of a person’s head and shoulders) to choose recipients from OS X’s Address Book. (When the Addresses palette appears, select a contact and click the To button to add it as a recipient; to add multiple recipients, add them one at a time, or command-click them to select them all and then click To. Note that Address Book contacts must have a fax number included for this to work.) If your phone line requires you to prefix phone numbers with a number or code—perhaps you need to dial “9” to get an outside line, or you need to provide a calling card number—type it into the Dialing Prefix field.

Figure 12.6: The Fax dialog, accessible from the Print dialog

The Subject field lets you provide a short subject to be included on the cover page of your fax. However, this information is shown on your outgoing fax only if you choose to include a cover page; to do so, check the box next to “Cover page” to enable it. If you’d like to include additional text on your cover page, type it into the cover page text box.

Tip

At the time of this writing, if you press the return key while typing text into the cover page text field (for example, because you want to add a line between sentences or paragraphs), OS X will interpret the return key as your acceptance of the default dialog button—in this case, the Fax button, causing your fax to be sent. If you want to include cover page text with multiple lines or paragraph breaks, you should type the text in a text editor or word processor, copy it from there, and then paste it into the “Cover page” text field in the Fax dialog.

Before sending your fax, make sure the correct modem is selected from the Modem pop-up menu. If you have only a single modem, it will likely be selected by default. However, if another Mac on your local network has faxing set up and Printer Sharing enabled, you’ll see that Mac’s fax modems, as well. (Selecting Show Fax List… will open Printer Setup Utility’s Fax List, which I cover below in “Man- aging Fax Queues.”)

Finally, you can use the Presets and options pop-up menus just as you would if you were printing the document to a local printer. I discussed these menus earlier in the chapter when I talked about Print dialogs. (The Fax Cover Page option is, in fact, simply an additional “printing” option that shows up only when you fax.) One of the more useful options is Scheduler, which lets you schedule when the document will be “printed” (i.e., faxed).

Tip

If you click the Preview button in the fax dialog, a preview of your document will open in the Preview application. Check the “Soft Proof” box at the bottom of the Preview window to see how your fax will actually look to the recipient, grain and all. Note that just as you would then print from within Preview if you were previewing a print job, you would then fax from within Preview via the File Ø Print… command, clicking the Fax… button in the resulting Print dialog.

Click Fax and Mac OS X will attempt to fax your document. (If your phone line is in use, OS X will wait until it’s free to send the fax.) The fax queue application for your fax modem will appear in the Dock, just as a print queue application appears when you print. In fact, managing fax queues works just like managing print queues.

Managing Fax Queues

As I explained earlier, sending a fax (“faxing”) is similar to sending a job to a printer (“printing”). As such, you manage your fax jobs just like you manage print jobs. Your fax queues are accessible in Printer Setup Utility by choosing View Ø Show Fax List; you can stop and start jobs by selecting a fax from the list and clicking the Stop Jobs (or Start Jobs, if applicable) button in the toolbar.

If you double-click a fax modem in the Fax List window (or select it and choose Printers Ø Show Jobs, or double-click the fax queue application itself in the Finder), you’ll be able to manage the fax queue exactly like you do a print queue, as I described earlier in this chapter under “Managing Print Queues.” In fact, fax queue applications are also located in /Library/Printers, and you can create a Desktop Printer for a fax queue (call it a Desktop Faxer, if you prefer) in the same way you would create one for a printer.

Did the Fax Go Through?

Unfortunately, at the time of this writing, Mac OS X’s fax functionality doesn’t include any kind of useful message or alert to let you know if a fax went through; it also doesn’t include a easily accessible fax log, as most fax machines and commercial fax software do. The easiest way to verify that a fax has been sent is to open the fax queue window as described in the previous section (via the Show Jobs command or by double-clicking the fax queue application). Once the fax is sent, it will disappear from the jobs list. If it doesn’t go through, it will remain in the job list until it is successfully sent.

Note

If your Mac loses the phone connection in the middle of transmitting a fax, the jobs window doesn’t tell you how many pages were successfully sent before transmission was cut off. Unless the person receiving the fax tells you where to start, you’ll have to start over to ensure all pages are received.

Alternatively, you can open the CUPS Web interface, as described earlier in this chapter, and then access the Show Completed Jobs screen for your fax modem—you’ll see a list of faxes sent from your computer, formatted just like the list of completed print jobs discussed earlier.

Sharing “Fax Machines”

If you enable Printer Sharing, as described earlier in this chapter, any fax queues you set up—in other words, any that show up in Printer Setup Utility’s Fax List window—will also be shared. This can be a very cool feature, as it means you can set up a “network fax.” On the other hand, if you want to enable Printer Sharing without sharing your fax queues, you’ll need to delete your fax queues after each time you fax. (As a side note, whereas you can share printers with Windows computers using Windows File Sharing, you can’t share fax queues.)

Receiving Faxes

I briefly mentioned receiving faxes earlier when I talked about the Faxing tab of Print & Fax preferences. Checking the “Receive faxes on this computer” is all you need to do to enable your Mac to receive incoming faxes (provided you’re connected to a standard phone line, and your Mac is on and awake, of course). However, you have a few more options as to how your Mac will receive those faxes (Figure 12.7). I already covered the “My Fax Number” option; here are some more details for each of the “When a Fax Arrives” options.

Note

Unfortunately, Mac OS X doesn’t discriminate between fax and voice calls as some fax machines—and even some third-party fax software—do. If you have your Mac set to receive faxes, it will answer the phone after the prescribed number of rings expecting a fax, which means it will send fax tones to the caller, regardless of whether or not a fax is incoming. If you use the same phone line for voice and fax calls, you may want to enable fax reception only when you’re actually expecting a fax. (Or you may want to consider a more full-featured fax software package; see “Better Fax Functionality,” below.)

Figure 12.7: Mac OS X’s fax reception options

Answer after # rings You determine how many rings your Mac should wait before answering the phone/fax line by typing the number in this field (or by using the up/down arrow buttons to choose a number).

Save to This option saves incoming faxes—in PDF format—to your hard drive. The default location is /Users/Shared/Faxes, which is great if your Mac is shared by several users, all of whom receive faxes. However, you can choose another folder instead—such as one inside your home directory, for privacy—by choosing Other Folder… from the "Save to" pop-up menu.

Email to This option will send a PDF copy of incoming faxes to the e-mail address(es) listed in the “Email to” text field. By clicking the Address Book button to the right, you can choose one or more addresses to which faxes should be sent. Alternatively, you can type address(es) into the text field; to add multiple addresses, separate them with commas (without any spaces). Note that in order for e-mailing to work, you must be connected to the Internet, which means that this option is more suitable for users who access the Internet via a broadband connection (or have separate fax and Internet dial-up phone lines).

Tip

Unfortunately, many users have found that the “Email to” option doesn’t work very well. If this sounds familiar, you may want to try the free FaxE-mailHelper (http://www.rwts.com.au/FaxE-mailHelper/), which not only fixes a few common OS X fax issues, but also lets you specify the "return address" on e-mailed faxes; lets you choose the SMTP server through which fax e-mails are sent; and runs a simulation so you can make sure everything is working properly.

Print on printer Enabling this option will automatically print incoming faxes on the printer you select from the pop-up menu—any printers available from the standard Print dialog will be listed—making your Mac emulate a “real” fax machine.

You can select any combination of these options. For example, you can have incoming faxes sent via e-mail and saved to your hard drive; this is useful if you want to receive all your faxes when you’re on the road but want to keep a copy at home, as well.

If you’ve chosen to save received faxes to your hard drive, double-clicking a saved fax opens it in Preview. Although you can of course change which application you use to view saved faxes, Preview handles multipage fax documents very well and even has fax-specific, anti-aliasing functionality to make grainy, messy faxes look (and print) much better than most “real” fax machines.

Be Alerted When a Fax Is Received

At the time of this writing, one of the (significant, in my opinion) drawbacks to Mac OS X’s fax system is that it doesn’t let you know when you’ve received a fax! Sure, you may hear the phone ring, but what if you have a dedicated fax line that doesn’t “ring”? Some users who would prefer to simply save faxes to their hard drive have chosen to also enable the options to print and/or e-mail faxes just so they have some way of knowing that a fax actually arrived.

If you’d prefer not to have to take such “drastic” actions, I’ve found a couple of solutions. The freeware FileMonitor (http://www.plsys.com/products/filemonitor/) is a general utility that, once launched, monitors any user-specified file(s) or folder(s) for changes. When it detects a change, it pops up a window letting you know which file/folder has been changed. The donationware Fax Alert Installer (http://www.brockerhoff.net/fai/index.html), on the other hand, is specifically designed for fax reception in OS X. It uses the Finder’s Folder Actions (discussed in Chapter 5) to "watch" the folder you’ve chosen as the destination for saving faxes in Print & Fax preferences; when a new fax is received, it pops up an alert dialog and even gives you the option of viewing the fax immediately (Figure 12.8).

Figure 12.8: Fax Alert Installer uses a Folder Action script to let you know when a new fax has been received.
Receiving Faxes Manually Using Terminal
User Level | admin
Affects | computer
Terminal | yes

Unfortunately, OS X’s fax functionality doesn’t allow you to manually receive a fax—fax reception is either on or off. If you’d rather receive faxes manually, your only option (besides a third-party fax solution) is to use Terminal. When the phone is ringing, and you know it’s a fax, type sudo fax receive filename <RETURN>, where filename is the path to and name of the file to which you want the fax saved. For example, sudo fax receive ~/Desktop/ContractFax.fax.

Tip

You can also send a fax using Terminal by typing sudo fax send phonenumber filename <RETURN>, where phonenumber is the fax number of the recipient and filename is the name of (and path to, if applicable) the file to be faxed. For example, sudo fax send 14155558574~/Desktop/document.ps. The only caveat is that the file needs to be saved as a PostScript file—as described earlier in this chapter—to fax it from Terminal.

Better Fax Functionality: Page Sender

Mac OS X’s built-in fax functionality is adequate for most users for the occasional sending/receiving of faxes. However, if you’re a frequent faxer, or require more advanced functionality, you’ll probably want to look elsewhere. The best Mac OS X faxing package I’ve seen is the commercial Page Sender by SmileOnMyMac (http://www.smileonmymac.com/pagesender/). Like OS X’s fax feature, Page Sender works via the familiar Print dialog. However, it offers significantly more functionality, such as the logging, viewing, and resending of sent faxes; the ability to manually send and receive faxes via a graphical interface; and support for custom cover pages and paper sizes. It also lets you send faxes to contacts contained in Microsoft Entourage, Now Contact, and Palm Desktop. It even supports a number of electronic fax services, such as eFax, MaxEmail, and EasyLink. Finally, it works under versions of Mac OS X 10 as far back as 10.1.3, whereas OS X’s built-in fax functionality is limited to OS X 10.3 and later. Page Sender isn’t free, but it’s a good example of "you get what you pay for."

Problematic Printing

Although printing generally works smoothly in OS X, sometimes things go wrong. I can’t get into every possible problem, or every possible solution, but the two solutions below generally fix the most common printing problems.

Note

Apple has a couple good Knowledge Base articles on troubleshooting printing at http://docs.info.apple.com/article.html?artnum=106714 (for OS X 10.3) and http://docs.info.apple.com/article.html?artnum=25385 (for OS X 10.2).

Running Repair Disk Permissions

Many printing-related problems are due to incorrect permissions on one or more files that are used by the printing system. This can happen because of file corruption, a misbehaving printer driver installer, or any number of other causes, but when it happens, the only thing you can do is get the permissions set correctly. Running Disk Utility’s Repair Disk Permissions function, as described in Chapter 1, is the best solution and will fix many printing problems.

Using Printer Setup Repair

The shareware Printer Setup Repair (http://www.fixamac.net/software/psr/) offers a variety of printing-related "fixes." Like Disk Utility, it can reset file permissions (although it confines its permission-fixing to printing-related files, whereas Repair Disk Permissions affects all system-level files on your startup volume). However, Printer Setup Repair can also repair problems with printing spools and the CUPS directory itself, delete troublesome temp and preference files, and even delete printer drivers (by manufacturer). It also keeps a log of all of its functions. Unfortunately, I don’t have the space to cover all of its functions in detail, but the ReadMe file that accompanies Printer Setup Repair provides a good deal of information about each function, including appropriate warnings about those functions that warrant them. Printer Setup Repair is one of the best troubleshooting utilities available for Mac OS X, in my opinion.

Note

If you’re still running OS X 10.2, you should instead use Print Center Repair, available from the same web- site as Printer Setup Repair.


Moving On...

Team LiB

Moving On…

In the previous two chapters, I showed you all the ways in which you could share files with others and access shares on other computers. In this chapter I also showed you how others can access your print- ers and printing queues. One of the consequences of having so many ways to communicate with other computers is that there are many ways for malevolent hackers to get into your computer—many more so than with the classic Mac OS. In the next chapter, I’ll discuss keeping your data and personal information safe from other users of your computer, from other users on your local network, and from nasty people “out there” on the Internet.


Part IV: Mastering Your Mac - Security, Maintenance, and Unix

Team LiB

Part IV: Mastering Your Mac—Security, Maintenance, and Unix

Chapter List

Chapter 13: Strengthening System Security and Fine-Tuning Firewalls
Chapter 14: Mac Maintenance and Administrative Actions
Chapter 15: Utilizing Unix


Chapter 13: Strengthening System Security and Fine-Tuning Firewalls

(Or: You don’t have to unplug your computer to keep it—and yourself—safe.)

Overview

One of the biggest computer-related topics nowadays is security: keeping your computer safe from hackers on the Internet, keeping your data safe from prying eyes, and keeping your e-mail and files safe from viruses. In this chapter, I’ll cover a range of topics relating to system security. I’ll show you how to use OS X’s built-in firewall to keep your computer private, and how to use OS X’s multi- user capabilities to keep your data private. I’ll show you how to prevent others from booting up your computer without your permission, and how to encrypt and delete your data to keep it super-safe. I’ll also cover OS X’s Keychain and how to take advantage of it. Finally, I’ll talk a bit about viruses and what you can do to keep them off of your Mac. Thankfully, OS X is pretty secure out of the box, but you can reduce or increase that level of security depending on how you use your computer.

Tip

There’s no way I can cover everything security-related in one chapter. If you’re interested in learning more about Mac OS security, be sure to surf over to http://www.securemac.com/.


Security Basics

When people talk about “computer security,” they’re really talking about three different topics: (1) keeping your computer safe, meaning preventing other people from gaining access to it (either over a network or in person); (2) keeping your data safe, meaning preventing others from accessing or using your data and personal information; and (3) keeping your computer virus-free. These three topics can actually be mutually exclusive. For example, you can allow someone to access your computer but still keep them from accessing your private data. You can also do a great job of preventing others from accessing your computer and your data but still be vulnerable to viruses. Because of this I’m going to divide this chapter into sections based on these three aspects of system security.

However, before I do that I want to talk about some more general pointers for keeping your computer safe and sound. Below are some guidelines that will increase the security of your system significantly. If you read nothing else in this chapter, read these:

Make sure you’ve installed the latest updates to your version of Mac OS X. Whenever a security vulnerability is discovered in Mac OS X, Apple generally releases a Security Update soon after (usually via Software Update). It’s a very good idea to make sure you install such updates, as they help secure the Mac OS itself. (Apple has provided a couple helpful lists of Security Updates at http://docs.info.apple.com/article.html?artnum=61798 and http://docs.info.apple.com/article.html?artnum=25631.)

Remember that accounts are your friend. User accounts are the backbone of OS X’s system security. Having a single account that anyone can access—many people use such a setup because they find accounts to be confusing, intimidating, or just a hassle—means that everyone has access to everyone else’s data. If nothing else, set up an admin-level account of your own, and create another non-admin account for your family or coworkers.

Limit administrative access to those who truly need it. Administrative access is a dangerous tool in the wrong hands, even if those hands aren’t purposely malicious. Limit admin-level accounts to only those people who need it regularly. For example, my computer has two admin-level accounts: my own and the emergency/troubleshooting account I recommended in Chapter 1. Every other account is a normal user. If someone needs to do something that requires administrative access, they can let me know. (In addition to limiting admin access, this also means that I’m aware of all admin access and actions.)

View the login window as “Name and password,” hide the Sleep, Restart, and Shut Down buttons, and disable password hints. If your Mac is in a public location, these login-related options are vital, for several reasons. (They’re especially important for laptops since a laptop is “exposed to the world” much more often than a desktop Mac.) First, it’s better to use the “Name and password” option (found in the Login Options screen of Accounts preferences) rather than “List of users” for the login window because listing all users makes it much easier for someone to hack into a computer—they only have to guess one piece of information (a password) instead of two (both the name of a user and that user’s password). Second, the “Hide the Sleep, Restart and Shut Down buttons” option—also found in Login Options—prevents people from restarting your Mac from the login screen (and possibly using one of the startup options, such as single-user mode, CD booting, etc., to gain access). Finally, although password hints are helpful for legitimate users, they also make it easier for malicious users to gain access to your Mac or other users’ accounts. Under OS X 10.2, you can disable password hints from the Login Options tab of Accounts preferences. Under OS X 10.3, at the time of this writing, disabling them isn’t quite as simple; see “Panther vs. Jaguar: Login Password Hint Options” in Chapter 3 for more details.

Disable automatic login. Although automatic login (discussed in Chapter 3) can be convenient, especially if you’re the only user of your Mac, it’s also a major security risk—anyone will be able to access your account without having to provide a username or password. This is especially risky if the account that’s set to automatically log in is an admin account, for all the reasons I outlined in Chapter 1; anyone who logs in will have free rein over your computer. You can disable auto- login in the Login Options screen of Accounts preferences—simply uncheck the box next to “Automatically log in as.” However, oddly enough, there’s another way to prevent it, as well. If you open the Security pane of System Preferences, enabling the “Disable automatic login” option will prevent auto-login, even if you’ve chosen to enable auto-login in the Login Options screen. (In fact, changing the setting in one of these two locations will also change it in the other.) In either case, this setting is available only to admin users.

Use good passwords. Your account password is the key to your computer. Just as some keys can be copied and some can’t, some passwords are easy to figure out and some aren’t. If you don’t want someone to access your account, don’t use a password that’s easy to figure out (e.g., your birthday, your significant other’s name, your pet’s name, your anniversary, your child’s name, your favorite sports team, etc.). The best passwords are random combinations of numerals and lowercase and uppercase letters. Unfortunately, the best passwords are also the hardest to remember. One trick is to think of a book or song title; take the first letter of each word, add a few numerals, change the case of a few letters, and you have a password that’s not too hard to remember but is still difficult for someone else to figure out. For example, take the song “(I Can’t Get No) Satisfaction,” add in the year the Chicago Bears won the Super Bowl, alter the case, and you get iC19gN86s. It looks pretty random, but you can reconstruct it quite easily if you forget it. (This advice goes for online passwords, as well—don’t use a weak password to access your bank account via your bank’s website!) Another good suggestion is to use different levels of passwords for different types of accounts. For “throwaway” accounts—registrations on websites that don’t have any real security concerns—use something easy to remember. For things that are important, such as your e-mail account or online banking sites, use more secure passwords, such as those described here. (In addition, especially for sensitive login information such as your name and password for online banking sites, be sure to read the next item on changing your password from time to time.) If you want some help in creating secure passwords, a utility such as the free RPG (http://www.well.com/~ddd/RPG/ ) can create truly random passwords that are extremely difficult to "crack."

Change your password periodically. Even the best password can be compromised. Someone might see you type it in, or you might connect to your computer or a website over a non-secured connection (meaning someone could “eavesdrop” on your network connection and get your password). To ensure security, you should change your password periodically. In fact, many network administrators force users to change their passwords on a monthly basis.

Only enable services that you regularly use. In Chapters 10 and 11, I explained how to enable various Sharing services and Remote Login. Although these are great features, the more of them you have enabled, the less protected your computer is from a network or Internet hacker. You should only enable those services that you actually need and use. In fact, if you use a service only infrequently (for example, to allow someone to access files on your computer on an as-needed basis), it’s safer to just enable that Sharing service when it’s needed and then disable it after you’re through.

Tip

I don’t cover the Remote Apple Events setting of Sharing preferences in this book. Apple Events are a way for applications to communicate with each other and are used extensively between applications on your own computer. However, it’s also possible for networked computers to use Apple Events to control applications on other computers. This can be quite helpful in some situations, but it also poses a significant risk if an application or person uses Apple Events maliciously. Suffice it to say if you need Remote Apple Events enabled, you’ll generally know it; if not, keep it disabled.

Keep the root account disabled. As discussed in Chapter 1, there’s little reason to have the root account enabled; you can generally do anything you need to do via the sudo command in Terminal or by launching specific applications as root using a utility such as Pseudo or Snard. But apart from the "don’t need" argument, there’s a compelling "should not" argument: since the root account is so powerful, if someone should figure out a way to log in to your computer as root, your entire system, and any data anywhere on your hard drive, is compromised.

Warning

If you really want to enable the root account, make sure you use a good password for that account!

If you connect remotely using an admin account, make sure you connect securely. When you connect to your computer remotely over a secure connection, all traffic between you and your computer is encrypted, meaning it’s encoded so that the data is useless to anyone who intercepts it. If you use a non-secure connection, it’s possible for your account name and password to be compromised and for someone else to later log in to your computer using them. Although any such breach is a bad thing, it’s much worse if the compromised account is admin-level. As I explained in Chapters 10 and 11, connection methods such as SSH, SFTP, SMB, and File Sharing are (usu- ally) encrypted; FTP and Personal Web Sharing aren’t.

Secure your physical location. This one may sound obvious, but you’d be surprised how many people do everything they can to secure their computer from remote access yet walk away from it—logged in to their account—in an environment where anyone can sit down and have full access. Although this isn’t as much of an issue in a single-user home environment, it can be a major issue in an office setting, or even in a home where parents and kids are using the same computer. (I’ll talk more about local security later in the chapter.)

Encrypt your wireless connections. If you have an AirPort Base Station or other wireless router, be sure to at least use WEP encryption (usually an option in the setup dialog or screen for your router). If you have an AirPort Extreme Base Station (or compatible third-party wireless router) and all your AirPort cards support it, use WPA encryption, which is even more secure. These security measures encrypt the signal between the router/Base Station and your computer so that anyone who might intercept that signal can’t easily access the data being transmitted.

Don’t open files, launch applications, or even mount disk images unless you know where they came from (and are expecting them). Unfortunately, most computer viruses are spread via files or applications that are opened by the user because they look innocuous. Although viruses are rare on the Mac platform, and most Windows viruses can’t do anything to your Mac, it’s better to be safe than sorry. On a related note, Mac disk images can be configured to run an application or script when mounted, so a malicious user could distribute harmful code this way. Be careful when mounting disk images if you aren’t sure where they came from.

Start Sidebar
The Security Pane of System Preferences

Instead of discussing the Security pane of System Preferences in a self-contained section, as I’ve done throughout the book with other preference panes, I’ll discuss each option found in this preference pane where it’s most appropriate. For example, I already mentioned the “Disable automatic login” option under “Security Basics,” and I talk about FileVault settings in “Keeping Sensitive Data Safe.”

The one setting in the Security pane I don’t discuss anywhere else is “Require password to unlock each secure system preference.” As discussed in Chapter 2, you can “lock” some preference panes so that they require an admin-level username and password to modify their settings. Normally, admin users can access settings in these panes without providing such authentication (unless they or another admin user have specifically locked System Preferences by clicking the lock icon at the bottom of the System Preferences window). However, with the “Require password to unlock each secure system preference” option enabled, all secure preference panes are locked and require authentication each time you access them. This prevents someone who happens upon your Mac when an admin account is logged in from making any changes. (Note that this option applies only to admin-level accounts. The preference panes in question are always locked for normal users.)

End Sidebar


Keeping Your Mac Safe: Networks and the Internet

The vast majority of today’s Mac users are on the Internet, many of them using broadband connections. Although this is great for browsing the Web, sharing files, playing games, and performing many other Internet-related activities, it also means that network security is much more important today than it was when most users were connected to the Internet via slow dial-up connections (if they were connected at all). Remember that when you connect to the Internet, you’re actually connecting to one huge network of computers, all of which can theoretically connect to, or at least contact, your computer. Some of those computers are used by people you want to be able to connect (Personal File Sharing users, for example), but most aren’t. If one of the more unsavory characters can find a way into your Mac, they may be able to erase files, steal personal information, or use your Mac as a relay for unsolicited e-mail or Internet attacks on other computers. Needless to say, these are officially Bad Things.

I already mentioned, both in the previous section and in Chapter 10, that three of the best things you can do to prevent unauthorized network access are to turn off unnecessary services (Personal File Sharing, FTP Access, Remote Login, etc.); make sure that users have effective passwords; and restrict access to secure methods such as Personal File Sharing, SFTP, and SSH. These steps are easy to take and provide a significant increase in system security—hackers generally try to take advantage of enabled services and use them as “doors” into a system. However, the truth is that even when you think you have all the windows of opportunity closed tight, it’s possible that the operating system itself has a security flaw. This is where firewalls come in.

What Is a Firewall?

At the most general level, a firewall is software that acts as a gateway between a computer or network and other networks. In the case of a single computer, a firewall is usually an application that watches all network traffic as it enters the computer. In the case of a network, the firewall typically operates on a router or gateway server through which all external traffic must pass. In either case, the firewall intercepts all incoming network traffic at the packet level (packets are small pieces of network data) and decides which packets of data should be forwarded to the network or computer, and which should be rejected.

Firewalls operate based on rules, set up by the firewall’s administrator; every packet of incoming data is compared to these rules and either forwarded to its intended destination or refused. Some rules are based on packet origin: Did the data come from a domain or IP address designated as “safe?” (The downside to these types of rules is that domains and IP addresses can be faked, or spoofed in network parlance.) Others are based on ports: Is the firewall supposed to allow network traffic on the port the packets are destined for? (You may remember the discussion of ports in Chapter 10.) Finally, rules can also be based on protocols: Is the transmission protocol used by the data (TCP or UDP) allowed, especially for the particular destination port? As a packet of data is compared to each rule, it’s either allowed or denied. If it’s specifically allowed by a particular rule, or makes it past all rules without being denied, it gets passed through the firewall to the network or destination computer. If the packet of data is denied by any rule, it doesn’t get through. Although each rule is surprisingly simple, the complete system of rules can be very complex.

Note

Most firewalls also include logging features that allow you to view a record of denied network traffic.

The benefit of a firewall is that unlike disabling specific services on your computer—which may still leave vulnerable ports open—a firewall enables access for only those ports you know you (or others on your network) need to use. Think of a firewall as the security guard for a gated community. Even if you happen to leave a window open in your house, the security guard should keep out anyone who might sneak in that window.

Note

In addition to keeping bad traffic out, firewalls can also restrict access to external content for computers behind the firewall. For example, a network administrator can restrict traffic from certain websites or close the ports used by streaming video or audio. This type of firewall use is especially common on larger networks, such as those in business and academic settings.

The most effective firewalls are dedicated computers that are separate from the rest of the network and do nothing else but act as firewalls; in this scenario the firewall computer can’t accidentally provide access to the network via its own security flaws. Many hardware routers provide effective firewall services for the same reason (see “Hardware Routers as Firewalls”). However, even software firewalls that run on your own computer can be extremely effective if set up properly. These firewalls monitor all the traffic that passes through your network ports (modem, Ethernet, AirPort, etc.). Mac OS X actually has a software firewall built-in; I’ll talk about it later in the chapter.

The biggest problem end users generally have with firewalls is one of convenience—if they’re too restrictive, you can’t access content you want to view (streaming media files, or even Web pages), and other users can’t connect to your computer to access Personal File Sharing and other services. Whether you’re using an Internet router or OS X’s built-in firewall (or both), in the next couple sections I’ll explain how to set up and use your firewall, including opening up access when you need to do so.

Hardware Routers as Firewalls

As I mentioned, most hardware routers provide firewall services. This is true even of the Internet routers many home users buy to share an Internet connection between multiple computers. As I discussed in Chapter 9, Internet routers use network address translation (NAT)—the process of translating the destination address of incoming Internet traffic to the internal IP address of the destination computer—to allow multiple computers to use a single Internet connection. If you request a Web page from a Web server, your Internet router knows to forward that data to your computer when it arrives. However, the flip side of NAT is that if a Web server sends a page that you didn’t request, it won’t be forwarded. Since the outside world can’t connect to a computer behind the router unless that computer specifically requested such contact, any unrequested traffic dies at the router. This system provides an effective firewall.

But what if your computer is behind an Internet router and you want certain people or computers to be able to initiate communications? For example, if you have Personal File Sharing enabled, users trying to connect to your computer to access files will have their attempts rebuffed out of hand by your router. In this situation, you need to set up port mapping on your router. If you remember from Chapter 10, every service on a computer is assigned specific ports. Personal File Sharing, for example, uses port 548. Port mapping (also called port forwarding) allows you to specify that all traffic to a certain port be forwarded to a particular computer behind the router, regardless of whether or not that computer initiated the exchange. In the example of Personal File Sharing, you’d tell your router that any unrequested incoming traffic for port 548 should be forwarded to the internal IP address of the computer with Personal File Sharing enabled.

How you do this varies from router to router, but most have a pretty straightforward interface, accessible from a Web browser on a connected computer. For example, our home has a Macsense XRouter (which is very similar to the popular Linksys routers); it has a settings page called Virtual Server that lets you map particular ports to internal IP addresses (Figure 13.1). (See “Port Portals: Common Ports Used by OS X Services” for a list of ports used by OS X for providing services.)

Note

As a rule, you don’t want to open too many ports using port mapping, since that port is then open for anyone, not just those who have legitimate reason to connect to your computer.

Click To expand
Figure 13.1: The port mapping settings for a Mac- sense Internet router
Start Sidebar
Port Portals: Common Ports Used by OS X Services

If your Mac is behind an Internet router and you need to use port mapping to allow others to access services on your Mac, here are the ports used by the most common OS X services. Keep in mind that you don’t need to map ports for services you access on other computers over the Internet (e.g., retrieving e-mail from your ISP); you need to worry only about ports for services your Mac is actually serving/providing to other computers over the Internet.

Port(s) | Protocol | Service
20 and 21 | TCP | FTP
22 | TCP | SSH (secure shell) and SFTP
80 | TCP | Web Sharing (HTTP), WebDAV, and iDisk
123 | TCP and UDP | Network Time Protocol (NTP) (used if you’ve enabled a network time server in Date & Time preferences)
137 and 138 | UDP | Windows Name Service (WINS) and Network Neighbor- hood (used by Windows File Sharing)
139 | TCP | Windows File Sharing (SMB)
427 | TCP and UDP | Personal File Sharing (AFP) and Web Sharing (HTTP)
443 | TCP | iTunes Music Store (HTTPS)
445 | TCP | SMB (without NetBIOS)
515 | TCP | LPR (Internet printing)
548 | TCP | Personal File Sharing (AFP)
554 | TCP and UDP | QuickTime Streaming (RTSP/QTSS)
631 | TCP | CUPS Web administration
2049 | UDP | Network File System (NFS)
3031 | TCP and UDP | Program Linking
3283 | UDP | Apple Network Assistant, Apple Remote Desktop
3689 | UDP | iTunes Music Sharing
5190 | TCP and UDP | iChat file transfers, AOL Instant Messaging
5297 | TCP | iChat via Rendezvous, Rendezvous
5298 | TCP and UDP | iChat via Rendezvous, Rendezvous
6970 and up | TCP and UDP | QuickTime Streaming (RTSP/QTSS)
7070 | TCP and UDP | QuickTime Streaming alternate (RTSP/QTSS)

For the full list of OS X ports, check out http://docs.info.apple.com/article.html?artnum=106439. Also, if you’ve installed third-party networking software (such as Timbuktu, discussed in Chapter 11), be sure to check its documentation to see if it uses a non-standard port. You can visit http://docs.info.apple.com/article.html?artnum=24514 for more information from Apple about ports in general.

End Sidebar

The downside to port mapping is that you can map a port to only one computer. In other words, if you have three computers behind an Internet router, all sharing a single external IP address, only one of the three computers can share files over the Internet via Personal File Sharing. All three will be able to share files with each other, but only the one that’s designated as the target computer for incoming traffic for port 548 will receive Personal File Sharing requests from the Internet at large. If you want another one of the computers to share files over the Internet, as well, you’ll need to use a different service (Windows File Sharing, SFTP, NFS, etc.) on that computer and have the corresponding port mapped to it.

Finally, some routers also have a feature that opens up NAT for all ports for one particular computer (often called a DMZ host). This feature is designed for use with computers running so many services that setting up port mapping would be too much of a hassle (or because the router doesn’t provide enough port mapping setting fields). I don’t recommend using this feature unless you absolutely have to since it defeats the purpose of having a firewall at all. Plus it doesn’t allow you to use port mapping for any other computer, as all ports are, by definition, mapped to the DMZ host.

Note

Having an Internet router doesn’t mean you should ignore OS X’s built-in firewall, especially if your Mac is connected to the Internet over broadband. Two layers of security are always better than one.

Mac OS X’s Built-in Firewall

Although firewalls used to be the purview of well-paid network administrators, nowadays many home computers take advantage of firewalls, either by installing third-party software or by taking advantage of security built into their operating systems. Mac OS X can do both. I’ll talk about third-party fire- walls—briefly—a bit later in the chapter, but the truth is that the firewall that comes with OS X, the Unix program ipfw, is actually quite capable, and Apple has provided a very simple interface for basic setup and configuration. In addition, with a little knowledge and/or some help from third-party utilities, you can customize it to be as comprehensive as you need.

Enabling and Configuring the OS X Firewall: The Basics

User Level | admin
Affects | computer
Terminal | no

To enable Mac OS X’s built-in firewall, open the Sharing pane of System Preferences, and then click the Firewall tab. Click the Start button, and the firewall is enabled. It’s really as simple as that.

The firewall comes preconfigured with several general rules that allow the Internet/network traffic most users would want while blocking traffic most users wouldn’t want. (See “OS X’s Default Firewall Rules” for a list of these default rules.) What’s more, it comes with a number of preconfigured rules that open traffic for particular Sharing services. If you enable any services in the Sharing tab of Sharing Preferences (Personal File Sharing, Remote Login, FTP Access, etc.), OS X automatically enables the corresponding firewall rule that opens traffic for the port(s) used by that service. You can see these predefined rules in the Allow box in the Firewall tab (Figure 13.2). To really appreciate how easy OS X makes this, switch to the Services tab in Sharing preferences and enable one of the services. If you switch back to the Firewall tab, you’ll see that OS X has automatically enabled the rule to allow access to that service. If you disable the service, OS X will disable the corresponding rule. (In fact, the only way to turn some of these particular firewall rules on and off is to turn their respective Sharing services on and off.)

Figure 13.2: Mac OS X’s firewall preferences
Note

As noted at the bottom of the Firewall tab, if you want to download files via FTP when the firewall is enabled, you need to open Network preferences, switch to the network port used for Internet access, and then switch to the Proxies tab. Check the box next to “Use Passive FTP Mode (PASV).” This enables passive FTP transfers. The reason this is necessary has to do with the difference between active and passive FTP modes; many firewalls block all active FTP traffic. (This procedure isn’t necessary if you just want other people to be able to connect to your Mac via FTP Access; it applies only if you intend to download files from other computers via FTP.)

You can also “open” ports in your firewall for many popular services by clicking the New… button. In the sheet that drops down, the Port Name pop-up menu lists some of the more common services (ICQ, IRC, Retrospect, and Timbuktu are a few examples). Select a service and the “Port Number, Range or Series” field lists the ports that will be opened; click OK, and the change takes effect. The new rule is then listed in the Allow box. What you’ve actually done is add a new rule to your firewall’s configuration file. To remove the rule, either uncheck it in the Allow box, or select it and click Delete.

If you’re using a service that isn’t listed in the Port Name pop-up menu (in the Edit… sheet)— for example, many file sharing systems such as Kazaa use specific ports—choose Other from the Port Name pop-up menu; the “Port Number, Range or Series” box will become editable. Enter the ports you need to open, enter a name for the firewall rule in the Description field, and then click OK to create the new rule. It will appear in the Allow box just like OS X’s predefined rules.

Start Sidebar
Firewall Rules Explained

As a Unix program, OS X’s firewall, ipfw, uses a simple text file for its settings. Each firewall rule is simply a line of text in that file. The basic rules for ipfw have a particular format:

RuleNumber allow/deny ip/tcp/udp from ip/any to port/any in/out/via

RuleNumber is a number assigned to the rule; incoming data is checked against rules in numerical order, so a lower number rule will be checked earlier than a higher number. This number is important because once a packet of data is allowed or denied (i.e., matches a rule), it doesn’t get checked against any other rule.

allow/deny is the action taken by a rule. An allow rule allows packets that match the rule to pass the firewall; a deny rule prevents matching packets from passing.

ip/tcp/udp designates which type of packets the rule should check: tcp, udp, or both (ip).

from ip/any designates which source the rule should check for; a specific IP address means the rule will only apply to data packets from that IP address, whereas any will check all data.

to port/any designates which destination port the rule should check for; including a specific port number means the rule will only apply to data packets destined for that port, whereas any means the rule applies to all destination ports.

in/out/via tells the rule to check incoming packets, outgoing packets, or packets passing through a particular interface (via). For example, the first rule of OS X’s firewall is allow ip from any to any via lo*. This rule tells the firewall to allow any traffic via the interface lo*. Its purpose is to allow traffic from any local service—* is a wildcard, meaning it matches any number of any characters. Another example of an ipfw firewall rule is allow tcp from any to 22 in. This rule tells the firewall that if it encounters incoming TCP traffic from any source to port 22 on your Mac, it should allow that traffic to pass.

As a packet of data enters your network port, it encounters the firewall, which checks it against the rules in numerical order. If the data packet doesn’t match the first rule, the firewall attempts to match the second rule, and so on. As soon as the data packet matches a rule, and is allowed or denied, the process stops.

There are actually many more options available in ipfw rules. If you’re really interested, type man ipfw <RETURN> in Terminal to see the ipfw man page.

End Sidebar

Configuring the OS X Firewall: BrickHouse

User Level | admin
Affects | computer
Terminal | no

In addition to the basic firewall configuration options offered in the Firewall tab of Sharing preferences, it’s possible to use Terminal or several third-party utilities to customize OS X’s built-in firewall. In fact, because of third-party utilities such as BrickHouse (http://personalpages.tds.net/~brian_hill/brickhouse.html) and Xupport (http://www.computer-support.ch/Xupport/info.html), there’s little reason for most users to even venture into Terminal to configure their firewall. (To be honest, I do use Terminal every once in a while to see a list of currently active firewall rules; type sudo ipfw list <RETURN> to see yours.)

BrickHouse is my pick as the most user-friendly utility for enhancing and extending the OS X firewall. Its Setup Assistant walks you through the process of customizing your firewall. When you first launch the application, it asks you how you connect to the Internet (Ethernet, modem, etc.), as well as whether you have a dynamic or static IP address. It then asks you what Public Services you want others to be able to access (Figure 13.3). All of OS X’s Sharing services are listed, but BrickHouse also includes many others, such as Quake 3 Arena (a network-based game), mail services (if you run your own e-mail server), and even high-end database services such as 4D and Oracle. If you click a service, BrickHouse will provide you with details about the service itself and the ports used by that service. Select any services you use regularly, and then click Continue. (Remember, you don’t need to enable things such as POP3 Mail to use e-mail; these settings are for services you are providing on your computer—you should only enable POP3, for example, if you were hosting an e-mail server. Also, don’t worry about things you might someday use but aren’t using now; you can always add rules later.)

Figure 13.3: BrickHouse’s Setup Assistant lets you add less common services to your firewall rules.

After choosing which services to allow (and thus which ports to open), the Firewall Setup Complete screen lets you apply the rules you just set up to the current firewall configuration by clicking Apply Configuration. If you want this configuration to be used every time your Mac boots up, click the Install Startup Script button. This installs a configuration script that applies your settings each time your Mac starts up. (Remember the discussion of the StartupItems folder in Chapter 3? This is an example of a script that resides inside that folder.)

Warning

The Setup IP Sharing button allows you to modify the settings for the natd program used by Mac OS X for Internet Sharing. Unless you’re using Internet Sharing and know exactly what you’re doing in terms of natd configuration, leave this button alone.

You can rerun the BrickHouse Setup Assistant at any time to reconfigure your settings (and install an updated startup script, if necessary) by clicking the Assistant button in the main window. However, you can also view and edit firewall rules manually. In the main BrickHouse window (which defaults to the Quick view), click the tab for the network interface you use for Internet access (Ethernet, Modem, PPP, PPPoE, or AirPort). You’ll see a list of rules (called Filters by BrickHouse) with their conditions— action, type of service, from, and to—clearly identified. To edit any Filter, select it and click Edit Filter (or click Delete Filter to remove it completely). You can add a rule by clicking Add Filter; BrickHouse provides a helpful interface for setting up the new rule. You can also edit the order that rules are applied—rules are listed in order from top to bottom, so to make a rule apply earlier, drag it toward the top of the list, or to make it apply later, drag it toward the bottom.

If you prefer to customize your firewall rules and settings manually, click the Expert button in the toolbar. You’ll be presented with a commented script that you can edit to your preference. However, like the IP Sharing settings, if you’re not 100 percent sure about what to do here, leave the Expert screen to the experts.

Start Sidebar
OS X’s Default Firewall Rules

If you enable OS X’s built-in firewall and have no Sharing services enabled, the firewall uses a fairly simple set of rules:

02000 allow ip from any to any via lo*

02010 deny ip from 127.0.0.0/8 to any in

02020 deny ip from any to 127.0.0.0/8 in

02030 deny ip from 224.0.0.0/3 to any in

02040 deny tcp from any to 224.0.0.0/3 in

02050 allow tcp from any to any out

02060 allow tcp from any to any established

12180 reset tcp from any to any setup

12190 deny tcp from any to any

If you enable any Sharing services, OS X automatically adds the appropriate rule(s) to allow that service to function properly:

02070 allow tcp from any to any 80 in (Personal Web Sharing)

02080 allow tcp from any to any 427 in (Personal Web Sharing)

02090 allow tcp from any to any 548 in (Personal File Sharing)

02100 allow tcp from any to any 427 in (Personal File Sharing)

02110 allow tcp from any to any 20-21 in (FTP Access)

02120 allow tcp from any 20,21 to any 1024-65535 in (FTP Access)

02130 allow tcp from any to any 3031 in (Remote Apple Events)

02140 allow tcp from any to any 22 in (Remote Login)

02150 allow tcp from any to any 139 in (Windows File Sharing)

02160 allow tcp from any to any 631 in (Printer Sharing)
End Sidebar

Regardless of how you made changes (using Quick or Expert view), click the Activate button in the toolbar to apply those changes to the current firewall settings. If you want those changes to be permanent, click the Install button in the toolbar to install an updated startup script.

Another great feature of BrickHouse is that you can create different sets of firewall rules using the Settings button in the toolbar and then switch between them as needed (remember to Apply changes after you switch between settings). Finally, BrickHouse also provides Log and Monitor windows that allow you to keep track of firewall activity (e.g., denied requests). You can even filter the log by rule number to see if a particular rule has been applied.

Tip

Using BrickHouse, you can actually enable the firewall for multiple network ports and in fact set up different firewall rules for each port. For example, if you connect to the Internet via Ethernet, but connect to other computers in your home or office via AirPort, you can set up different firewall settings for each. Simply check the Filter This Interface box in the tab of each network port for which you want to enable the firewall, and then configure each network port’s (Interface’s) rules/filters the way you want.

To remove BrickHouse’s configuration, choose Options Ø Clear All Filters and then click the Apply button. (If you’ve installed a startup script, also choose Options Ø Remove Startup File.) You can then go to the Firewall tab of Sharing preferences and set up the firewall as you normally would.

Third-Party Firewalls for OS X

In addition to OS X’s built-in firewall, there are also several third-party firewalls on the market, including the shareware Firewalk X (http://www.pliris-soft.com/products/firewalkx/index.html), the commercial Norton Personal Firewall (part of the Norton Internet Security package, http://www.symantec.com/sabu/nis/nis_mac/index.html), and the commercial Intego NetBarrier (http://www.intego.com/netbarrier/home.html). Third-party firewalls work in much the same way your built-in firewall does. However, they also tend to add a better interface (much like BrickHouse), as well as more "convenience" features. For example, FireWalk X and Personal Firewall allow you to specify which applications can (or can’t) access the Internet, which can protect you from Trojan horses—applications that try to covertly send data from your computer. All three also offer firewall logging and monitoring, and instant alerts (via sounds, pop-up messages, and/or e-mails) to let you know when unauthorized attempts to access your Mac are made.

In addition, Intego NetBarrier and Norton Privacy Control (the latter comes bundled with Personal Firewall in the Norton Internet Security package) provide an innovative approach to protecting your personal data. They allow you to enter confidential data, such as credit card numbers, social security numbers, unlisted phone numbers, passwords—any kind of info you want to make sure doesn’t get surreptitiously obtained—into a database. They then watch all outgoing Internet and network traffic; if one of your private bits of data is being sent out, they stop it, let you know what the data is and where it’s being sent, and ask for your approval. If you want to regularly allow a certain piece of data to be sent to a specific website or computer, you can also specify such an exception. (See the next section for another approach to monitoring outgoing data.)

Tip

If you’ve installed a third-party firewall, you can’t use the Firewall tab of Sharing preferences to control Mac OS X’s built-in firewall until you remove the other firewall software. Similarly, if you’ve used a third-party utility to modify OS X’s built-in firewall, you need to remove the changes made by that utility before you can use the Firewall tab of Sharing preferences. However, even after doing this, sometimes Mac OS X won’t let you use the Firewall tab, instead giving you an error message that “Other firewall software is running on your computer. To change the Apple firewall settings, turn off the other firewall software.” If you find yourself in this situation, quit System Preferences, and then open Terminal and type sudo ipfw -f flush <RETURN> (provide your admin password when prompted). The next time you open Sharing preferences, you should be able to edit settings in the Firewall tab.

Monitoring Outgoing Network Connections: Little Snitch

User Level | admin
Affects | computer
Terminal | no

Firewalls are great for preventing unauthorized network access to your computer. With a bit of work, you can also use them to effectively prevent unauthorized access from your computer—for example, to prevent applications (including malicious Trojan horses) from sending sensitive data without your permission. However, most users just don’t want to deal with the effort involved to set a firewall up in this manner.

I mentioned NetBarrier and Norton Privacy Control in the previous section, but both of those utilities require you to designate specific data that you don’t want transmitted. What if you simply want to watch out for any attempt to send data over the network/Internet? The utility Little Snitch (http://www.obdev.at/products/littlesnitch/index.html) is an ideal alternative. Little Snitch sits in the background and watches for any application-initiated network activity. When it detects such activity, it pops up an alert panel with the details (the name of the application and what server/IP address/ domain the application is trying to contact). You can then decide whether to deny the connection this time, allow it this time, or create a rule to allow or deny similar connections in the future.

When you first install Little Snitch, you’ll see a bunch of these alerts—the first time you check your e-mail, for example, you’ll need to OK the network activity (preferably, in the case of e-mail, by creating a rule allowing all e-mail checks in the future). But after you’ve built up your rules for common network/ Internet events, Little Snitch will generally bother you only when an application is trying to do something you don’t want it to do (or, at the very least, something you haven’t yet authorized).


Keeping Your Mac Safe: Local Access

As I mentioned earlier in the chapter, an effective firewall can’t stop someone from walking up to your Mac and trying to access it. In order to truly have a secure computer, you also need to secure it from local access. You can take several approaches to local security, including preventing startup, enabling auto-logout, and locking the screen when you step away from the computer. I’ll talk about each of these approaches in the next few sections.

Note

Although home computers aren’t as susceptible to local “hacking” as those used in office environments, you may still find some of these techniques useful, especially if you keep sensitive data on your home computer, or if you have children that you don’t want using the computer unsupervised.

Securing Startup: Open Firmware Password Protection

You may recall that I talked about Open Firmware in Chapter 3. As part of your Mac’s BootROM, it loads at the beginning of the startup process, which means that Open Firmware controls all access to your Mac. By enabling Open Firmware Password Protection, your Mac can be booted—this includes a startup after a restart—only by someone who knows the Open Firmware password, or can be restricted to boot only using the startup volume selected by an admin user the last time it was booted (i.e., so someone can’t reboot your Mac and change startup volumes to circumvent security). In addition, all other startup options listed in Chapter 3 (single-user mode, booting from a CD, safe boot, target disk mode, etc.) are disabled to prevent a malicious user from using them to gain access to your computer.

Warning

Open Firmware Password Protection is a great security feature, but here are a few caveats: (1) Before enabling Open Firmware Password Protection, make sure your Mac is compatible with this feature and has the latest version of Open Firmware installed. You can find a list of compatible Macs and firmware updates at http://docs.info.apple.com/article.html?artnum=106482. Related to this, DO NOT update your Mac’s firmware with Open Firmware Password Protection enabled, or you risk not being able to boot your computer at all! If you need to update firmware, disable Password Protection first. (2) Do not use a capital U in your Open Firmware pass- word—at the time of this writing, such passwords will not be recognized. (3) If you normally use a keyboard layout other than a U.S. layout, switch to the U.S. keyboard layout before setting your Open Firmware password. (You can switch it back later.) The reason for this is that your Mac assumes a U.S. keyboard layout during the boot process, so you want to use that keyboard layout to create the password; if you don’t, it will be very difficult to provide the correct password!

Enabling Open Firmware Password Protection

User Level | admin
Affects | computer
Terminal | no

There are two ways to enable Open Firmware Password Protection. The easiest way is to down- load Apple’s Open Firmware Password utility, available at http://docs.info.apple.com/article.html?artnum=120095. After you launch the utility, click Change. Check the box next to "Require password to change Open Firmware settings," and then click OK. You’ll be asked to authenticate using an admin username and password, and then you’ll be told that your settings were successfully saved. Enabling Password Protection this way provides the "command" level of Open Firmware protection, which simply prevents startup commands—such as those discussed in Chapter 3 under "Special Startup Options"—from being used. It still allows users to restart the computer and boot up again.

For an additional level of security not provided via Apple’s utility, you can enable “full” Open Firmware protection, which not only disallows startup commands but also disallows startup itself unless you provide the correct Open Firmware password. However, to enable full protection, you need to restart your Mac and invoke Open Firmware at startup:

  1. Restart or start your Mac, holding down command+option+O+F. This will bring up the Open Firmware prompt.

  2. At the prompt, type password <RETURN>.

  3. When prompted, enter the password you want to use and then press return. Enter it again for verification, and press return again.

  4. At the prompt, type setenv security-mode full <RETURN>. This enables "full" Open Firmware protection.

  5. Type reset-all <RETURN> to restart your Mac. As your computer restarts, you’ll of course be required to provide your Open Firmware password.

Tip

Full Open Firmware Password Protection is active and you need to temporarily use a different startup disk at startup, hold down the option key as if you were invoking the Startup Manager. Enter your Open Firmware password when prompted, and Startup Manager will then appear.

Disabling Open Firmware Password Protection

User Level | admin
Affects | computer
Terminal | no

If you want to disable Open Firmware Password Protection permanently, or if you just need to disable it temporarily in order to reset your Mac’s PRAM, use single-user mode, or access other startup options, you have two options. The first (which assumes your Mac is already booted into OS X) is to launch the Open Firmware Password utility, uncheck the “Require password” box, and then click OK. Once you provide an admin username and password, the Open Firmware password will be removed.

You can also disable protection by booting into Open Firmware:

  1. Restart your Mac and hold down command+option+O+F until you see the Open Firmware prompt.

  2. Type setenv security-mode none <RETURN>.

  3. Type the existing password when prompted, and then press return.

  4. Type reset-all <RETURN> to restart.

Password protection will now be disabled. To enable it again, use the procedure described in the previous sections.

Recovering from a Forgotten Open Firmware Password

User Level | anyone with hardware access
Affects | computer
Terminal | no

Open Firmware Password Protection is the most secure method of local protection you can use on your Mac without buying third-party security software (and it’s even better than some of those). The downside to this is that if you lose your Open Firmware password, you could be in trouble! However, in the event this ever happens, there is a “back door” to gain access to your Mac:

  1. Open your computer’s case to expose the RAM slots.

  2. Add or remove RAM—you basically need to change the total amount of RAM in your computer—and then close your computer up again. (If you only have one DIMM [RAM module], you’ll need to add RAM since you won’t be able to remove any.)

  3. Start up your computer, holding down command+option+P+R until you hear three chimes. This resets your computer’s PRAM three times.

  4. Release the keys and allow your computer to startup normally.

The Open Firmware password is now disabled. You can shut down your computer and restore its RAM to the previous amount.

Of course, you’ll notice that the above procedure doesn’t require a password, or even an admin account on the computer in question. Anyone with access to your Mac’s RAM slots can do it, which is why if you have a desktop Mac, you should place a padlock on the lock slot to keep others from opening it up (especially if your Mac is in a public location). If you have a PowerBook or iBook, you’re especially susceptible to this trick since you can’t lock the RAM slots.

Note

If your Mac can boot into Mac OS 9, you can instead use the Classic application FWSucker (http://www.securemac.com/openfirmwarepasswordprotection.php#fwsucker) to extract your Open Firmware password from NVRAM (a bit of low-level memory where the Open Firmware password is stored). However, this utility doesn’t appear to work in the Classic environment.

Securing Single-User Mode

User Level | admin
Affects | computer
Terminal | yes

I talked about single-user mode in Chapter 3. Because it allows a savvy user to modify anything on the boot volume, it’s definitely a security risk. One way to prevent single-user mode access is to enable “full” Open Firmware Password Protection. However, if you’d rather just prevent access to single- user mode—while still allowing other startup options—here’s how:

  1. First you need to enable a single-user mode password. This is technically the “root” password—remember all that talk about the root user in Chapter 1?—but since the single-user mode password is contained in a different database than OS X’s normal root user password, the two passwords can actually be different (and, in fact, you can enable the single-user mode password without enabling the root account). To enable this password:

    1. Launch Terminal, and type sudo passwd -i file -l /etc/master.passwd root <RETURN>.

    2. Provide a new password when prompted; you’ll be asked to retype it for verification purposes.

  2. Next you need to enable password protection for single-user mode.

    1. Launch a text editor, such as TextEdit, as root, as described in Chapter 1.

    2. Open the file /etc/ttys in the text editor to edit it.

    3. Find the line that says console "/System/Library/CoreServices/loginwindow.app/ Contents/MacOS/loginwindow" vt100 on secure onoption="/usr/libexec/getty std.9600". It will most likely be the first line that doesn’t have a # symbol at the beginning.

    4. Change the word secure to insecure. (Yes, that’s just a little counterintuitive.)

    5. Save your changes.

From this point on, if you or anyone else attempts to enter single-user mode at startup, you’ll be required to first provide the password you just created.

Auto-Logout: Log Users Out Automatically

User Level | normal or admin
Affects | individual user or computer
Terminal | no

If your biggest security problem is that you (or others) forget to log out after using the computer, you can take advantage of one of OS X’s built-in features to automatically log users out. Open the Security pane of System Preferences, and check the box next to “Log out after # minutes of inactivity.” Then decide how many minutes of inactivity you want to use as the “trigger” for automatic logout. If the active user doesn’t do anything (move the mouse, press a key on the keyboard, etc.) for that amount of time, they will be logged out. (Be sure you make the time limit long enough to allow for normal pauses in work—it can be pretty annoying to be logged out just because it’s taking you a long time to read a particular page on the screen.)

Warning

Be aware that the auto-logout feature performs an ungraceful logout, meaning that applications quit immediately without prompting the user to save open documents. However, if your main concern is security, this is probably less of a concern than leaving an account logged in.

Auto-logout may not be the best solution for a computer used by only one or two people (see the next section for another approach), but in a lab or other public setting, it can be extremely valuable.

If you’re running OS X 10.2 or earlier, you don’t have the auto-logout feature. However, you can take advantage of a feature you do have—the screen saver—to approximate this feature. The freeware screen saver module LogOut (http://homepage.mac.com/swannman/FileSharing1.html) works just like any other screen saver module, but instead of dimming the display or filling the screen with interesting graphics after a period of inactivity, it (ungracefully) logs the current user out and returns the Mac to the login screen. (I recommend against assigning any screen saver Hot Corners when using this module, as a stray mouse movement might log users out accidentally.)

Locking the Screen

If you want to prevent access to your account but don’t want to log out (e.g., if you’re just stepping away from your computer for a few minutes), your best bet is to lock the screen. OS X includes a few ways to do this.

Locking the Screen via the Screen Saver or Sleep

User Level | any
Affects | individual user
Terminal | no

I covered OS X’s screen saver in Chapter 2, but it also provides a helpful security feature. In the Security pane of System Preferences, if you select “Require password to wake this computer from sleep or screen saver,” you’ll be required to provide your account password when exiting the screen saver. This is a good feature for keeping your computer somewhat secure when you step away—after a set amount of inactivity (set in the Screen Saver tab of Desktop & Screen Saver preferences), the screen saver will kick in, providing password protection with it. (In OS X 10.2 and earlier, you enable this feature in the Activation tab of Screen Effects preferences.)

To make this feature a bit more effective, you should choose a screen saver Hot Corner (by clicking the Hot Corners… button in the Screen Saver tab). With a Hot Corner active, if you’re about to step away from your computer, just drag the cursor into that corner, and the screen saver/password protection will be activated immediately.

This feature also applies to waking your Mac from sleep, so you can instead set your computer to automatically sleep after a certain length of inactivity via the Sleep tab of Energy Saver preferences. When you or anyone else tries to wake the computer up, your account password will be required. (To get this functionality in OS X 10.2 and earlier, take a look at SleepLock, available at http://spazioinwind.libero.it/macosx/index.htm.)

Note that in either case, any admin user can provide their own username and password to bypass the screen saver or “wake” password dialog. Although some may consider this to be a security flaw, keep in mind that admin users can access your account in many other ways, as well. If anything (and I know I keep repeating this throughout the book), it’s yet another reason to limit admin access.

Tip

When Fast User Switching is enabled, if another user needs to access their account while the screen is locked in your account, they can click the Switch User… button in the password dialog to switch to the login screen. They can then log in to their own account!

Locking the Screen via the Keychain Menu Extra

User Level | any
Affects | individual user
Terminal | no

The problem with using Screen Effects to lock your screen is that if you don’t set a Hot Corner, there’s a delay (set by you in Desktop & Screen Saver preferences) between when you stop working and when the screen saver starts; on the other hand, if you enable a Hot Corner, it’s easy to hit that corner with the mouse unintentionally, locking your screen. A better solution, in my opinion, is to use the Keychain menu extra. The Keychain menu extra’s main purpose is to allow you to access your Key- chain, but it also allows you to lock the screen immediately. (I’ll talk about OS X’s Keychain, and the Keychain Access application, in a bit.)

You can enable the Keychain menu extra from within the Keychain Access application, located in /Applications/Utilities. After launching Keychain Access, choose View Ø Show Status in Menu Bar, and the menu extra will be added to the menu bar (it will look like a small padlock); it will remain there even after you quit Keychain Access. To lock your screen, simply choose Lock Screen from the new menu; whatever screen saver you’ve chosen (in the Desktop & Screen Saver pane of System Preferences) will be started, but to stop the screen saver and get back to work, you’ll need to enter your account password—even if your Security preferences aren’t set to require a password when exiting the screen saver.

Note

Although locking the screen via the Keychain menu extra functions just like enabling a screen saver password, the two are actually independent; you can use a screen saver without the lock, but can still gain the benefit of the lock when you want it.

Locking the Screen via Fast User Switching

User Level | any
Affects | individual user
Terminal | no

If you’ve enabled Fast User Switching as described in Chapter 1, you have yet another option for securing your Mac without logging out. Simply choose Login Window… from the Fast User Switching menu in the menu bar; Mac OS X will switch to the main login window, but your account will remain active. You can switch back to your account, and any other user can switch to their own account, by logging in normally.


Keeping Sensitive Data Safe

For the most part, securing your Mac (physically and over a network) means that your data is safe, as well—if no one else can get to your data, no one else can use it (or abuse it). However, if you’re really concerned about security, it’s good to have an additional layer of protection. After all, there’s always the chance that someone can gain access to private files and folders. For example, if your computer is ever stolen, all bets are off. Likewise, if someone, somehow, gains admin access to your Mac, they can use the root account and/or sudo in Terminal to access any user’s files, even those in your private user folder. Finally, remember that OS X’s permissions aren’t enforced when booted into OS 9. Thus, if you have data that’s particularly sensitive—confidential documents, passwords for online accounts, etc.—you may want to consider additional security.

Mac OS X provides a few solutions for securing sensitive data and personal information, including the Keychain, file encryption, and secure file deletion. In addition, you can enhance these abilities via third-party software. I’ll talk about all of these in the following sections. In addition, if you have multiple volumes and/or partitions, be sure to check out the section on permissions and security in Appendix A, as non-boot volumes handle permissions differently than your main OS X volume.

Note

Many people use invisibility—making files invisible so that other users can’t see them—as a mild form of security. This is only a passable tactic for hiding files, and it’s definitely not a legitimate method for securing data. Any semi-experienced user will be able to easily find such files using the Finder’s Find command or Terminal.

The Mac OS X Keychain

The Mac OS X Keychain is another one of those features that’s incredibly powerful but rarely under- stood. What is it? The short answer is that—like its namesake, a ring that holds all your keys—the Keychain is a database that holds your passwords. The long answer is that the Keychain is a secure database that not only stores passwords for everything from websites to servers to encrypted files and images but also provides a mechanism whereby applications can access those passwords automatically (with your permission, of course). It also allows you to securely store other information as needed.

The idea of the Keychain is fairly revolutionary: When you log in to your account, your Keychain is unlocked. Whenever you enter your password in a dialog—on a website, in a server connection dialog, when mounting a protected disk image—Mac OS X asks if you want to store that password. If you agree, a new password entry is added to your Keychain. The next time that same password dialog appears, the application requesting your password connects to the Keychain and says, “Hey, can I have the password for this?” Assuming you’ve given that application permission, the Keychain responds, “Sure, here it is.” You don’t have to remember each and every password, and you don’t have to manually type the appropriate password every time you want to access a password-protected site, server, disk, or file.

There are two caveats to realizing the potential of the Keychain. First, applications must be written to be Keychain-aware. In other words, if an application doesn’t explicitly work with the Keychain, your passwords can’t be automatically stored and, more important, can’t be automatically retrieved. The second is actually a built-in security measure: To add a password to the Keychain, you must specifically tell Keychain to add it, and for an application to access that password you must specifically allow it. (I’ll talk more about how to do both in the next section.)

In addition to its ability to work with applications to make your password-laden life easier, the Keychain also has two other convenient uses. You can use it to store passwords used by applications that aren’t Keychain-aware—or passwords that aren’t being used on your computer at all—by manually adding those passwords, and you can store larger batches of text using secure notes. I’ll talk about both in a bit.

Note

Your original Keychain was created when your user account was created, and by default it has the same password as your user account. This allows your Keychain to be unlocked automatically when you log in. However, you can lock and unlock your Keychain manually at any time, and you can change your Keychain password so that it isn’t automatically unlocked at login. I’ll talk about these options in “Working with Your Keychain: Keychain Access.”

Using the Keychain with Keychain-Aware Applications

User Level | any
Affects | individual user
Terminal | no

Using the Keychain with applications that are Keychain-aware is actually very easy. The first time you provide a password (e.g., when connecting to a server, mounting an encrypted disk image, checking e-mail), the password dialog will include a checkbox that says something to the effect of “add password to Keychain” (different applications phrase it differently). Alternatively, some applications, such as Safari, will present a dialog that specifically asks if you want it to remember a password for you. If you agree (by checking the box or clicking the “Yes” or “Agree” button), your password is saved. (What you’ve actually done is created a new Keychain entry; I’ll talk more about these entries in the next section.)

The next time you access that same server, image, e-mail account, etc., the application will access your Keychain and attempt to automatically retrieve the correct password. For most applications, and the Mac OS itself, you’ll receive a dialog asking if you want to allow access (Figure 13.4). Clicking Deny prevents the application from grabbing the password this particular time (in which case you’ll need to enter it yourself). Allow Once allows access this particular time, but you’ll be asked again the next time this password is requested by the application. Always Allow will allow the application to access the password this time and any time in the future (although you can manually reverse this decision, as described in the next section). Click the Details triangle to see more information about the request, including which Keychain is being accessed and which application (or system component) is making the request for access. (In the case of website passwords in Safari, you don’t see this dialog; the information is automatically entered in the appropriate fields on the Web page.)

The key here is that applications must be Keychain-aware. For example, e-mail clients such as Apple’s Mail and Microsoft’s Entourage support the Keychain, as do Web browsers such as Safari and Camino. The Finder is also Keychain-aware, which means that you can save passwords for any server you access via the Connect To Server dialog. Unfortunately, some other popular applications, such as Microsoft’s Internet Explorer, don’t support the Keychain.

Note

If an application changes in any way—for example, if you update it or install a new version—its access to the Keychain is reset, even if you previously chose to Always Allow access to a particular password. The next time it requires that password, you’ll be asked to Deny or Approve access again. This may be annoying, but it serves a good purpose—to prevent a hacker from accessing your private data by altering an application. If one of your applications starts asking for permission to access your Keychain, and you didn’t just update the application or Mac OS X, be concerned.

Working with Your Keychain: Keychain Access

User Level | any
Affects | individual user
Terminal | no

Figure 13.4: You can deny or allow an application access to your Keychain.

Your Keychain generally operates in the background, working with applications when needed. However, there are a number of reasons why you might need direct access to it. OS X provides this access via the Keychain Access utility, located in /Applications/Utilities. When you launch this application, you’re presented with a list of all the items in your Keychain (Figure 13.5), including information about each item’s name, kind, creation date, and modification date. You can sort the listing by any of these attributes by clicking a column header (or by choosing View Ø Sort Ø column). You’ll notice that your Keychain can actually contain both passwords (Internet passwords, application passwords, disk image passwords) and secure notes. I’ll talk about secure notes in a bit, under "Adding Keychain Items: Secure Notes."

Click To expand
Figure 13.5: Keychain Access lets you view and edit Keychain items.
Viewing and Editing Keychain Items

Selecting any Keychain item provides information about that item at the bottom of the window. The Attributes tab provides information about the contents of the item. In the case of passwords, it lists the name of the item (often the domain of the website or server, or the name of the application it applies to); the kind of item (Web form password, Internet password, application password, secure note, etc.); the account name, if applicable; the specific URL, application name, or disk image name the password is used for; and any comments you may have added about the item. In addition, if you check the “Show password” box, you can view the password stored in that item (you’ll be required to enter your Keychain password to do so). The “Copy Password to Clipboard” button will copy the password to the clipboard so that you can paste it into another application (again, after providing your Keychain password).

In the case of secure notes, the Attributes tab shows the name of the note, the creation and modification dates, and a “Show note” box instead of a “Show password” box (although it works the same way).

You can edit any of these fields by simply clicking in the field; however, the only ones you should generally change are the Comments field and the passphrase field (which, oddly enough, isn’t labeled but is located just below the “Show password” checkbox), and even then, only if your password has actually changed. When you’re done editing, make sure you click the Save Changes button at the bottom of the window.

The Access Control tab is where you control access to the Keychain item. By selecting “Allow all applications to access this item,” any application that requests the password or note can access it without any interaction from you. If you select “Confirm before allowing access,” a dialog will appear each time an application requests access—this is the dialog I mentioned earlier that gives you the choice to Deny, Allow Once, or Always Allow. In addition, if you enable the “Ask for Keychain password” option, this dialog will also require your Keychain password for an extra layer of security. The “Always allow access by these applications” box lists any applications you’ve given permission to access this item. If you want to add applications (for example, if you change e-mail clients or Web browsers and want the new one to be able to access your e-mail or website passwords), click Add and navigate to the application. (You can also select an application and then click Remove to prevent it from accessing this password in the future.) Again, after making any changes here, click Save Changes to apply them.

Note

If you want to compare two or more Keychain items simultaneously, you can open multiple Keychain Access windows by choosing File Ø New Window (or Window Ø New Viewer Window in OS X 10.2).

Adding Keychain Items: Passwords

In addition to allowing applications to add new Keychain passwords, you can manually add them yourself. To create a new Keychain password, click the Password item in the toolbar, or choose File Ø New Password Item… A dialog will appear asking you for the name of the new item (e.g., Mac.com e-mail account), the account or username associated with the password (e.g., dfrakes), and the password/ passphrase you want stored in the Keychain. If you check the Show Typing box, you’ll be able to see the password as you type it. Click Add to create the new item. If you want to associate the new password item with a particular application, select the item and then add an application in the Access Control tab as described above.

Tip

You don’t have to restrict your Keychain to just passwords used by applications. It’s also a great place to store any other passwords or numbers you need to remember: bank “phone-teller” codes, PINs, ATM card passwords, even software serial/registration numbers. Using your Keychain is a lot more secure than writing them down on paper!

Adding Keychain Items: Secure Notes

In addition to storing passwords in your Keychain, you can also create secure notes. Secure notes are just standard text notes, but because they’re part of your Keychain, they’re safe from prying eyes— no one can view them unless they have your Keychain password. They’re a great way to store sensitive data—anything you need to keep private. Secure notes are one of those “hidden” features that Apple should make more obvious.

To create a secure note, click the Note item in the toolbar, or choose File Ø New Secure Note Item…. In the New Secure Note Item dialog, enter a name for the new note, and then type (or paste) the contents of the note. Click Add, and the note is created.

Deleting Keychain Items

If you ever need to delete a Keychain item (you cancel an account, you no longer need a secure note, etc.), just select the item and click the Delete item in the toolbar (or choose Edit Ø Delete). You can also control/right-click the item and choose Delete from the contextual menu.

“Going” to Keychain Items

The Keychain Access toolbar has an item called Go that looks like the @ character (visible in Figure 13.5). What this button does depends on what kind of Keychain item is selected when you click it. If a secure note is selected, Keychain Access simply switches the Attributes display to that note. However, for password items, the item is actually “opened.” Internet passwords open your preferred Web browser to the URL listed in the Where field of Attributes. Disk image passwords attempt to mount the password-protected disk image. iDisk passwords attempt to mount your iDisk in the Finder. Application passwords launch the application listed in the Access Control tab. Although I personally don’t use this feature much, I can see how it might be a nice shortcut.

Locking and Unlocking Your Keychain

Even if your Keychain is unlocked, passwords and notes contained in your Keychain are inaccessible by default. However, chances are you’ve enabled Always Allow access to many passwords for convenience, so some applications have free reign over their passwords, so to speak. If you want to tempo- rarily prevent any applications from accessing passwords in the Keychain, or if you’re stepping away from your computer and want to make sure no one can access the information in your Keychain, you can lock it. A locked Keychain is inaccessible by applications and can only be opened/enabled/ unlocked by providing your Keychain password (by default, your account password).

There are several ways to lock your Keychain. The first is to launch Keychain Access and click the Lock item in the toolbar (which then changes to Unlock). You can also choose File Ø Lock Keychain “keychain name” or File Ø Lock All Keychains (useful if you have multiple Keychains—see “Creating and Deleting Additional Keychains”). To unlock the Keychain again, click the Unlock item in the toolbar or choose File Ø Unlock Keychain “keychain name,” and then provide your Keychain password.

Another way to lock and unlock your Keychain is to use the Keychain menu extra, enabled by choosing View Ø Show Status in Menu Bar (from within Keychain Access). Once enabled, the Key- chain menu extra appears in your menu bar, system-wide; you can lock and unlock your Keychain (or Keychains, if you have more than one) by simply clicking the Keychain menu extra and choosing the appropriate item from the menu. You’ll be asked for your Keychain password, of course, to unlock a Keychain. (You’ll remember the Keychain menu extra from earlier in the chapter when I showed you how to lock your screen.)

Finally, you can have your Keychain automatically locked after a period of inactivity, as described in the next item.

Changing Keychain Settings

The Keychain Access application doesn’t have its own preferences; however, each Keychain has settings that control the behavior of that particular Keychain. To access these settings, launch Keychain Access and choose Edit Ø Change Settings for Keychain “keychain name”….

Note

If you have multiple Keychains, each has its own settings. Click the Keychains item in the toolbar (or choose View Ø Show Keychains) to see a list of Keychains; select a Keychain and then access the Settings dialog.

The first setting, “Lock after x minutes of inactivity,” will automatically lock the Keychain after the number of minutes of inactivity you choose here. Activity is defined as your accessing the Keychain, including viewing or editing any Keychain item or any application accessing the Keychain. Note that if your e-mail client stores your e-mail account passwords in the Keychain, and checks for new mail frequently, it’s possible that your Keychain may never lock using this feature.

The second option, “Lock when sleeping,” automatically locks your Keychain when your computer goes to sleep. When you wake your computer, you’ll be required to enter your password before you or any application can access your Keychain.

Changing the Keychain Password

You can also change the password for your Keychain by choosing Edit Ø Change Password for Key- chain “keychain name”… Enter the current password, type the new password twice, and then click OK. However, note that if you want your Keychain to be automatically unlocked at login, it must use the same password as your user account. Thus, if you change your Keychain password, you might want to also change your account password so that they match.

Note

If you change your own account password in Accounts preferences, your Keychain password will automatically be changed to match. However, if you use your admin power to change another user’s account password, their Keychain password won’t be automatically updated, and thus won’t automatically be unlocked when they log in. They’ll need to change their Keychain password, in Keychain Settings, to match their new account password.

Testing the Quality of a Password: Password Assistant Because your Keychain can contain lots of data that you want to keep private, you want to make sure that you use a good password. In OS X 10.3 and later, Keychain Access provides a very cool feature to help you out in this respect. When you change your Keychain password, a small i button is shown at the bottom of the Change Keychain Password dialog. Click this button, and a Password Assistant window appears. Type your proposed password in the New Password field, and the Password Assistant provides feedback on it. If the bar is red, your password is, well, pretty bad. As your password quality increases, the bar turns orange, then yellow, and then green (and the Quality number increases). In addition, messages in the Password Assistant window tell you if the password is too short, too simplistic, too similar to your current password, etc. (Figure 13.6). Use these tips to help you create the “perfect” password. The example password I gave at the beginning of this chapter, iC19gN86s, gets a quality rating of 53.6 and a marginal “green.”

Figure 13.6: The Password Assistant window tells you if your new password could be better.
Tip

If you want to make sure your entire user account in OS X has a good password, you can use the Password Assistant feature of Keychain Access to come up with a secure password for your Keychain and then change your account password to the new Keychain password in Accounts preferences.

Creating and Deleting Additional Keychains

Although every user has a single Keychain by default, it’s actually possible to have more than one. For example, perhaps you want to keep your personal Keychain data separate from your business/professional Keychain data. To create a new Keychain, choose File Ø New Ø New Keychain… You’ll be asked to name the new Keychain and then provide and verify a Keychain password; this password can be the same as or different from your existing Keychain password.

There are a few things to be aware of when working with multiple Keychains. First, by default Key- chain Access shows the contents of your original Keychain. To view others, click the Keychains item in the toolbar, or choose View Ø Show Keychains, and a drawer showing all accessible Keychains will slide out of the side of the main Keychain Access window. If you select one of your Keychains from the list, Keychain Access will show its contents.

Tip

You can view multiple Keychains simultaneously by opening multiple Keychain Access viewer windows and choosing a different Keychain in each.

The second thing to consider is that one of your Keychains is automatically designated as your default Keychain. You can change this setting by selecting another Keychain in the Keychain Files drawer and then choosing File Ø Make Keychain “keychain name” Default. Which Keychain you select doesn’t affect the ability of applications to access Keychain information; however, when you choose to add a password to the Keychain, it’s always added to the default. Thus, if you’re using one Keychain for personal info, and one for business info, you need to switch the default back and forth each time you want to add a password to one or the other.

Finally, only your default Keychain will be unlocked at login, even if all of your Keychains use the same password as your user account.

To delete a Keychain, select it from the Keychain File drawer and then choose File Ø Delete Key- chain “keychain name.” You’ll be asked if you want to delete just the references to the file (meaning the Keychain file will still exist, but it won’t show up in Keychain Access unless you add it again—see “Transferring a Keychain to a Different Account or Different Mac”) or if you want to delete both references and the Keychain file itself.

You can also delete Keychains manually in the Finder—they’re stored in ~/Library/Keychains. If you quit Keychain Access and then drag a Keychain to the Trash, the next time you launch Keychain Access the Keychain will no longer be available.

Warning

Once you delete a Keychain, it’s gone for good, as is all the data contained in it. Be sure that you really don’t need it, or that you’ve transferred its contents to another Keychain, before deleting it.

Transferring a Keychain to a Different Account or a Different Mac
User Level | any
Affects | individual user
Terminal | no

If you’ve built up a hefty Keychain—one with a lot of entries, notes, etc.—you can actually use that Keychain with a different user account or on a different Mac. Some examples are if your main Key- chain is on your desktop Mac, and you want to use it on your PowerBook; if you’ve just created a new user account (or purchased a new Mac) and want to transfer over all of your passwords; or if you’re using a friend’s Mac or a Mac in a lab. Here’s how you do it. (If you have multiple Keychains, just follow the procedure here for each one.)

  1. Make your Keychain (located at ~/Library/Keychains) accessible by the other computer or account. You could burn it to a CD or copy it to a portable hard drive, or even copy it to an iDisk and then connect to the iDisk from that computer or account. If you’re just moving the Keychain between accounts, you could put a copy of the file in your Public folder or in the Shared folder and change permissions to allow access by everyone—don’t worry, no one can open it without your password.

  2. Log in to the account you’ll be using.

  3. Launch Keychain Access, and choose File [head2right] Add Keychain.

  4. Navigate to your Keychain in the Open dialog, and click Open.

  5. When prompted, provide the Keychain password. Your Keychain will be added.

Note

After adding your Keychain in this manner, you’ll probably actually have two or more Keychains since the account you’re using already had its own original Keychain.

When Keychains Break: Keychain First Aid

User Level | any or admin
Affects | individual user’s Keychain
Terminal | no

Because the Keychain manages so many different pieces of information—and the more information it manages, the more frequently it’s accessed—it’s possible for your Keychain file to eventually develop minor corruption. Keychain corruption is generally manifested in problems such as your e-mail client repeatedly asking you for your mail account password, even though it’s saved in your Keychain; your .Mac password not being saved in .Mac preferences; or OS X repeatedly asking you to unlock your Keychain. If you experience such odd behavior, there’s a good chance your Keychain needs to be repaired.

Under OS X 10.3 and later, Keychain Access includes the ability to repair Keychains via Window Ø Key- chain First Aid. (If you’re running OS X 10.2 or earlier, Apple instead provides a separate utility called Keychain First Aid, which can be downloaded at http://docs.info.apple.com/article.html?artnum=107234.) After opening the Keychain First Aid window, enter your username and password, select Verify, and then click Start. Your Keychain will be checked for problems. If any are found, you’ll see a description of each, and you’ll be prompted to repair them (Figure 13.7). Select Repair, and then click Start. You can copy, print, or save the log of any verification or repair via the Edit and File menus.

Figure 13.7: Keychain First Aid found problems with this Keychain.

An administrative user can also verify and repair other users’ Keychains. Instead of entering your own username and password, enter the username and password of another user. (Unfortunately, you must know the user’s password or else change it first using Accounts preferences.) When you click Start, you’ll be prompted for an admin username and password. One main difference here is that when verifying or repairing another user’s Keychain, you won’t see the details of the verification or repair.

By default, repairing a Keychain using Keychain First Aid resets the settings for that Keychain to unlock at login and remain unlocked until logout. You can change this behavior in Keychain First Aid Preferences (accessible in OS X 10.3 by clicking the Options… button in Keychain First Aid, and in OS X 10.2 and earlier by choosing the Preferences item in the Keychain First Aid menu). The preference dialog also includes a button called Reset My Keychain. Clicking this button preserves your existing Keychain but creates a new, empty, default Keychain.

Alternatives to the Keychain

Although the Keychain is incredibly useful, and does what it does very well, many people find its secure notes and general password/data storage functionality to be a bit limited compared to other available options. If you want a more flexible way to store sensitive text, the shareware LittleSecrets (http://www.mani.de/en/index.html) allows you to create multiple note databases, each encrypted and requiring its own password. Each database can store as many separate notes as you want, using styled and colored text (the Keychain supports only plain text). In addition, each database of notes is searchable, which is a major plus if you’re working with lots of text. Finally, LittleSecrets is Keychain- savvy, so you can actually store your database passwords in your Keychain.

If you’re looking for a more convenient way to store passwords and other information for use in non-Keychain-savvy applications (or just information such as PINs, credit card numbers, and other private info), a search for “password” on the VersionTracker or MacUpdate websites will present you with a number of choices. My favorites are the shareware Web Confidential (http://www.web-confidential.com/) and Password Retriever (http://www.koingosw.com/). Both allow you to view multiple items at once, like Keychain Access; provide options for categorizing and viewing items; can automatically generate random passwords for you; and encrypt their databases using extremely secure algorithms. Web Confidential has the advantage of integrating nicely with many browsers (it’s related to URL Manager Pro, which I recommended earlier in this book), and is Keychain-aware itself, so you can save your Web Confidential database password in your Keychain.

Encrypting Data

If you’re careful with account passwords and file permissions, your data is pretty safe from other users—provided they can’t access your user account. If that’s a risk for some reason, or if you’re just the extra careful type, you can add another layer of security by encrypting especially sensitive files and folders so that even if someone can get to them, they can’t use them. To put it simply, encryption is the process through which data is encoded so that only someone with the correct password can access that data. Mac OS X provides a couple of options for encrypting data, depending on whether you want to encrypt just a few files, or if you want “everything” encrypted.

Encrypting Files and Folders Using Disk Images

User Level | any
Affects | individual user
Terminal | no

Although there are a number of third-party utilities that provide the ability to encrypt files, OS X lets you do this quite easily using Disk Utility, which I described in Chapter 7. First, choose Images Ø New Ø Image from Folder. In the Open dialog that appears, select the folder of data you want to encrypt and click Open. In the resulting Save dialog, select the desired Image Format (use read/write if you want to be able to edit or change the files you’re encrypting), and then select “AES-128 (recommended)” for Encryption (this uses 128-bit encryption, which is a very secure algorithm for encoding files). Click Save to save the encrypted disk image in the location you’ve selected. You’ll be asked for a password and whether or not to add that password to the Keychain; click OK, and the image will be created.

To use an encrypted disk image, simply double-click it in the Finder. If you chose to add its password to your Keychain, it will be mounted automatically; otherwise you’ll need to provide the password each time you mount the image (which is the most secure, if not the most convenient, approach).

Note that in OS X 10.2 or earlier, file/folder encryption is handled by the Disk Copy utility; in fact, you can simply drag a folder of files onto the Disk Copy icon in the Finder or the Dock, and you’re presented with a dialog to save an image of the folder. You can then select the appropriate image format and encryption. If you have a copy of Disk Copy from OS X 10.2, it still works in OS X 10.3, and you can still use it to encrypt folders of data via drag-and-drop.

Warning

To quote Apple, “the encryption used…is 128-bit, equivalent to that used in the banking industry. If you forget the password to your encrypted disk image, your data will be irretrievably lost.”

Note

If you create an encrypted image to store sensitive documents, be sure to delete the original documents afterward— I’ve forgotten to do this myself before. If you want to securely delete such files, check out the section on secure deletion later in this chapter.

Instead of encrypting an existing folder, you can also create a blank encrypted image and then drag documents to it as needed. Although I explained how to do this in Chapter 7, you can read Apple’s official instructions at http://docs.info.apple.com/article.html?artnum=107333.

Finally, one other cool use of encrypted disk images is to send data securely over the Internet— if you encrypt a file or files and then send the encrypted image as an e-mail attachment, it’s virtually impossible for anyone who might intercept that e-mail to gain access to the data (provided you didn’t include the password in the body of the e-mail, of course).

If you’d like an even higher level of encryption, and/or if you’d prefer the ability to encrypt files and folders directly (instead of via disk images), you may want to consider a third-party utility such as the commercial software Tresor (http://www.warlord.li/english/tresor.php). Tresor uses even better encryption technology than Disk Utility and lets you drag and drop files and folders onto the Tresor icon to encrypt them immediately.

Encrypting Your Entire Account: FileVault

User Level | any
Affects | individual user’s data
Terminal | no

Although the ability to encrypt individual files and folders is useful, it can be a bit of a hassle, especially if you want to protect a good number of files. If you’re the extra cautious type, OS X 10.3 and later include the ability to encrypt your entire home directory via a feature called FileVault. Each user can enable/disable FileVault for their own account via the Security pane of System Preferences—click the Turn On FileVault… button to start the process. (This option is also available from the Security tab of Accounts preferences.) You’ll be asked for your account password, at which point you’ll be given a stern warning about the risks of encrypting your entire home directory (Figure 13.8). Click Turn On FileVault, and you’ll be logged out of your account while OS X encrypts your home directory.

Note

In order to enable or disable FileVault for an account, no other users can be logged in.

Figure 13.8: Mac OS X points out the importance of remembering your password when using FileVault.

What really happens when FileVault is enabled for an account is that Mac OS X creates an encrypted, sparse disk image, mounts it, copies the contents of your home directory onto that image, and then deletes the originals. The encrypted image is in fact just like one you might create using Disk Utility with 128-bit Advanced Encryption Standard (AES) encryption. From that point on, whenever you log in to your account, OS X mounts the encrypted disk image “in place of” your actual home directory—your home folder appears, to you, no different than it did before. Data in your home directory is decrypted and encrypted on the fly—unless you have a slower Mac, or are working with extremely large files, you probably won’t even be aware that it’s happening. (If you enable FileVault for your account, your home folder’s icon will change to a FileVault icon—a house with a padlock dial— to remind you that your account is encrypted.)

Note

One major difference between a standard home directory and one with FileVault enabled is that, whereas a standard home directory provides access to the Public and Sites folders, a FileVault-enabled home folder doesn’t allow other users any access at all.

When you log out of your account, OS X unmounts the encrypted disk image, making its contents inaccessible. In fact, if other users open your home folder in /Users, they’ll see nothing but a disk image called username.sparseimage.

Note

If you provide another user with your account password, they’ll be able to mount your FileVault disk image in the Finder and access files/folders inside it as long as you aren’t currently logged in. You can use this to your advantage to create a single image that multiple users can use to securely store shared files. Simply create a new user account and enable FileVault for it, and then share the password for that account with the other users of your Mac. Whenever someone wants to access a file on, or save a file to, the encrypted image, they simply double-click the /Users/username.sparseimage file to mount it. (If you mount another user’s FileVault disk image, make sure to unmount it when you’re finished— that user won’t be able to log in as long as you’ve got their FileVault image mounted!)

Setting a Master Password
User Level | admin
Affects | computer
Terminal | no

Because losing or forgetting your password when FileVault is enabled would be disastrous, Mac OS X provides a “safety net”—a master password. This master password is different from the root account password described in Chapter 1. In fact, it isn’t associated with any account at all. Rather, it’s a master FileVault password that allows you (or anyone who knows the master password) to unlock any FileVault-enabled account on your Mac. Because it’s so important to have a such master password, OS X won’t let you enable FileVault on any account without first providing a master password; if you try, you’ll be prompted to provide one.

To do so, open the Security pane of System Preferences and click the Set Master Password… button. (Or, as mentioned above, simply attempt to enable FileVault for your user account.) Type in a master password, and then type it again to verify it. (See the discussion at the beginning of this chapter about choosing good passwords.) You can also provide a hint in case—nightmare of nightmares— you forget the master password, too. Click OK to set the master password. (After you’ve set a master password, the button reads “Change” instead; you can click this button to change the master password in the future.)

Using the Master Password to Access a FileVault-Enabled Account
User Level | admin
Affects | individual accounts
Terminal | no

If you (or one of your users) forget your account password, and your (or their) account has FileVault enabled, you’ll have to resort to the master password to gain access to that account. However, the way to do this isn’t very intuitive. You basically have to attempt to log in normally via the login screen, but type the wrong password three times in order to bring up the “hint” display. A button that reads “Reset Password…” will appear; click it, and then type the master password and click Continue. (You’ll see a message stating that this will not change the Keychain password for the account in question; in fact, it will create a new Keychain. You—or the user—will still be able to access the previous Keychain manually.)

A dialog will then appear asking you (or the user) for a new password and password hint for the account. (Considering that the original password was forgotten, I recommend providing a hint this time to ensure that it doesn’t happen again!) Click “Log in,” and the user will be logged in to their account.

Disabling FileVault

If you enable FileVault and later decide that you don’t want your account encrypted, simply open the Security pane of System Preferences and click the Turn Off FileVault… button. You’ll see a notice that this will log you out while OS X unencrypts your home directory; click Turn Off FileVault to proceed.

Caveats of FileVault

Although FileVault is a great feature if you need it, it has a few caveats. The first, and most important, is that since File Vault uses such strong encryption, if you forget your password, you won’t be able to access your data. Ever. Apple has provided the master password back door described above, but if you (and, if applicable, all other admin users) forget it, any FileVault user who forgets their password will lose their data forever.

The second caveat, close in importance to the first, is that because all of your data is stored in a single file (the encrypted FileVault disk image), the risks of losing data due to file or hard drive corruption increase when using FileVault. If the FileVault disk image somehow gets damaged, there’s a chance that OS X won’t be able to mount it, making your data inaccessible! If you need data security, this may not be enough reason to avoid using FileVault; however, it’s a compelling argument for making sure your data is backed up regularly. (See Chapter 14 for more information about backing up.)

The third caveat relates to actually backing up your data. Unless you want to back up your entire FileVault disk image every time your backup utility runs—keep in mind that home directories are often many GB in size—you need to actually be logged in to your account during backups, and you need to set up your backup utility to only back up logged-in accounts. (Of course, this creates a bit of a security risk in that the data is being backed up unencrypted; hopefully your backup media is stored in a safe place.)

Another drawback that may affect you is that because the disk image containing your home directory is unmounted when you log out, and because it doesn’t allow other users any access even when you’re logged in, this means that your Public folder (discussed in detail in Chapters 1 and 10) isn’t available to other users, local or remote. The same restriction holds true for your personal Sites folder, which contains any files you want to make available via Personal Web Sharing.

Another issue relates to disk performance. Since FileVault needs to decrypt/encrypt all data on the fly, if you do a lot of disk-intensive work—for example, using iMovie or Final Cut Express/ Pro—make sure you locate your movie files outside of your home directory. Otherwise the overhead of encrypting and decrypting these large movie files will adversely affect the performance of these applications.

Finally, when you enable FileVault, your home directory is copied to the new encrypted disk image, but the contents of your home directory aren’t securely deleted (a process explained in more detail in the next section); they’re simply deleted from your drive normally during the process. This means that it’s possible for someone with the right tools to recover those files. If you had sensitive data in your home folder before enabling FileVault, after enabling it you should securely erase the “free” space on your hard drive, as described in the next section.

It may sound like FileVault has a lot of caveats. The truth is that it does, and it’s really not for everyone. In my opinion, it’s mainly for laptops and public Macs that have a higher than normal chance of being stolen or hacked. For the average home user, or even business user, it’s most likely overkill.

Securely Deleting Files and Erasing Free Space

User Level | any
Affects | individual user’s data
Terminal | no

One of the biggest myths of computer use is the idea that “deleting” a file really gets rid of it. Most people assume that when you empty the Trash, your file is gone forever. The truth is that the file is still sitting exactly where it was before you deleted it. What actually happens is that the operating system “forgets” the file exists and makes a notation in the disk directory that the space occupied by that file is now available to store other data. But until other data—a file, an application, etc.—is actually saved to that location, the original file is still there. In fact, it’s possible to “undelete” the file, and there are utilities available on every computer platform that do just that. (I’ll talk about a couple for OS X in the next chapter.) In addition, there are companies (and, for the X-Files fans, departments in government agencies) whose sole business is retrieving “deleted” data from hard drives.

This is normally not a problem, as you usually don’t care if an item is technically still on your hard drive—you just don’t want to see it and you want to make the space it occupied available for other data. However, if you have especially sensitive data that you want to delete, and you want to make sure no one can retrieve it, you want to delete it securely. Secure deletion is the process by which not only is a file removed from the disk directory, but the area of the drive where that file was stored is actually overwritten by new data—sometimes by a constant stream of zeros (since all data on a hard drive is actually a series of zeros and ones), sometimes with a random sequence of data. In addition, the more times you overwrite the space, the less likely it is that anyone would ever be able to retrieve the file. (The government’s intelligence agencies actually have a standard number of overwrites that they classify as “secure.”)

Mac OS X 10.3 and later actually provide the ability to securely delete files. Simply move the files in question to the Trash, and then choose Finder Ø Secure Empty Trash. Not only will the files currently in the Trash be removed from your hard drive’s directory but the blocks on your drive on which those files resided will also be overwritten seven times with random ones and zeros in order to prevent them from being recovered. (According to Apple’s Mac OS X Product Manager, “This method follows the U.S. Department of Defense standard for the sanitization of magnetic media in ‘DoD 5220- 22-M: National Security Program Operating Manual.’” In other words, it should be good enough for you and me.) If you’re using OS X 10.2 or earlier, a number of third-party secure deletion utilities exist for OS X; one of the best is the shareware SafeShred (http://codetek.com/safeshred/). It offers security protection from "Home User" to "Secret Agent" (basically, how many times a file is overwritten with random data). To securely delete a file, you simply drag it onto the SafeShred icon.

Note

If you’ve installed an application that helps you “undelete” files by keeping a cache of recently deleted files (such as Data Recycler X or TechTool Pro, discussed in the next chapter), you should realize that even if you use the Finder’s Secure Empty Trash function to securely delete the original file, these utilities keep a copy on hand, which basically defeats the purpose of using Secure Empty Trash. To make sure you securely erase files with one of these utilities active, you should use a third-party utility such as SafeShred; these utilities delete files without ever placing them in the Trash. (Data Recycler X actually includes a utility called Data Recycler Express Shredder; if you don’t want Data Recycler to keep a copy of a deleted file, you can drag it onto the Express Shredder icon and it will be securely deleted immediately.)

Warning

When you drag an alias onto an application, the application will try to open the original file, not the alias— that’s how aliases are supposed to work. However, this also means that if you drag an alias onto SafeShred or any other third-party secure deletion utility, the original file will be deleted, not the alias! You should generally delete alias files by simply dragging them to the Trash.

What if you’ve previously deleted files that you wish you’d securely deleted? Many utilities allow you to securely overwrite all “free” space on a drive to ensure that any files that have previously been deleted aren’t retrievable. SafeShred, mentioned above, is one; another is the shareware Shredder (http://www.dekorte.com/Software/OSX/Shredder/). Both have a Shred Free Disk Space feature that overwrites free disk space using the same Department of Defense standard used by the Finder’s Secure Empty Trash feature.

Warning

Before you use any utility that securely deletes files, or securely erases free disk space, be sure you don’t want the file, or that there are no deleted files that you might ever want to try to unerase—these procedures will make that virtually impossible.

Before You Get Rid of Your Drive or Computer…

Along the lines of the previous paragraph, what if you’re about to sell your computer, or get rid of a hard drive, and you want to make sure no one can retrieve any data from it? Your best bet is to use a utility such as SafeShred or Shredder to securely erase free disk space. However, if you’re using OS X 10.2.3 or later, another option is to use Disk Utility’s “Zero all data” option (accessible via the Options… button on the Erase tab). This will write a value of 0 to every single block on the drive. For additional security, run this option multiple times—magnetic media can sometimes have a “memory” effect that make it possible to extract previous block values, and multiple “zeroing” reduces the chances of this. If you’re using OS X 10.3 or later, Disk Utility has an even better option: “8 Way Random Write Format.” This option writes random ones and zeros over the entire drive eight times.

Note

The “Zero all data” and “8 Way Random Write Format” options of Disk Utility are available only for entire hard drives, not individual partitions. In addition, they may not be available for some third-party hard drives. For more information about this feature, visit http://docs.info.apple.com/article.html?artnum=107437.


Protecting Yourself (and Your Friends) from Viruses

Viruses are the bane of a Windows user’s existence. Between Outlook viruses, Outlook Express viruses, data-deleting viruses, Trojan horses, and any number of other nasty things transmitted from one computer to another, it’s almost impossible (and certainly unwise) to use a Windows computer without an antivirus utility. Fortunately, the Mac OS (both OS 9 and OS X) is fairly virus-free. Windows viruses generally take advantages of technologies or security flaws in Windows to do their damage, so the Mac OS isn’t susceptible. And although there are Mac viruses, they’re very rare. This means that whereas antivirus software is a requirement on a Windows PC, on the Mac side the issue is more one of “Am I at risk?”

If you don’t download a lot of new, strange software, don’t really exchange data (CDs, Zip disks, floppy disks, etc.) with other Mac users, and don’t receive lots of e-mail from Windows users, you’re actually at a pretty low risk for “viral infection.” Most viruses are transmitted via e-mail attachments (which is why I told you at the beginning of the chapter never to open an attachment you didn’t ask for), infected downloads, or files swapped with infected computers, so if you don’t interact with any of these things, chances are you’re pretty safe.

However, if you do tend to come in contact with these types of files, a good antivirus utility such as Norton AntiVirus (http://www.symantec.com/nav/nav_mac/index.html), Intego VirusBarrier (http://www.intego.com/virusbarrier/home.html), or Virex (free to members of Apple’s .Mac service) will ensure that you don’t catch the latest computer flu. These utilities automatically scan down- loaded files and removable media, check e-mail attachments before you open them, and even watch for suspicious activity on your hard drive. If they find a virus, they "disinfect" it, or else warn you not to open the infected file. They also check for the latest virus definitions over the Internet to make sure your antivirus software can catch even the newest bugs.

Tip

Mac users regularly receive Windows viruses as e-mail attachments. Although these viruses can’t hurt your Mac, they can still hurt the Windows PCs used by your friends, family, or business associates! Thus, good antivirus software (such as the products mentioned here) also prevents you from passing on a Windows virus to your Windows friends.

In addition to traditional viruses, there are also viruses that infect Microsoft Office files. These files, called macro viruses—which are actually much more common for Mac users than traditional viruses—take advantage of the macro programming language available in Word and Excel to infect your computer. Word and Excel actually provide you with a warning when you open a document that contains macros—the one you probably always ignore (I know I do). Thankfully, most antivirus utilities also protect you against macro viruses.

Note

Most virus “warnings” you’ll see—especially if the warning comes to you in an e-mail—are hoaxes. Before you worry about the “latest” virus, check out sites such as http://www.sarc.com or http://hoaxinfo.com/vhoax.htm which list real viruses and hoaxes.


Moving On...

Team LiB

Moving On…

Files, the Finder, applications, the Dock, networking, security…I’ve covered most of the topics that deal with using your Mac and OS X, so you’re heading down the home stretch. In the next chapter I’ll show you how to keep your Mac in tip-top shape through some old-fashioned Mac maintenance.


Chapter 14: Mac Maintenance and Administrative Actions

(Or: How to keep your Mac in tip-top shape.)

Overview

Thus far in this book I’ve showed you how to better use Mac OS X and, I hope, how to better understand it. However, in this chapter I’m going to take a detour and spend some time showing you how to keep your Mac running smoothly and how to perform some basic administrative tasks. I’ll cover routine disk maintenance and repair, disk fragmentation and optimization, clearing cache files, and using Unix cleanup routines. I’ll also talk about reading log files, adjusting application priorities, and automating and scheduling tasks. Finally—and possibly most important—I’ll cover some basics about backups.

The contents of this chapter will help to ensure that you can actually use your Mac over the long haul—in other words, so you can spend your time enjoying OS X instead of worrying about disk problems, slowdowns, and lost files. In addition, you’ll learn a few tricks that will let you run your Mac like a pro.

Note

In the interest of readability, in this chapter I use the terms drive, disk, and volume interchangeably.


Disk Drive Diligence

Today’s hard drives are marvels of technology. They store upwards of billions of bits of data on tiny magnetic sectors, and spin as much as 24 hours a day, yet the vast majority of time they work problem-free and last for years. Unfortunately, things can and do go wrong, but even then there are things you can do to keep your drives running well, and to fix them when they aren’t.

Note

A number of third-party hard drive repair and maintenance utilities are available for OS X; the truth is that it can get pretty confusing trying to figure out which ones do what. In the discussion that follows, you’ll get a good idea of the features and abilities of each. I don’t have the space to give you a how-to or walk-through of each, but by giving you a taste of which utilities to consider for particular uses, you’ll be better able to decide which you might want to purchase for yourself. Note that almost all disk utilities currently available for OS X are incompatible with the UFS volume format. (HFS Plus is the default for Macs, but UFS is an option if you manually reformat a volume.)

Warning

Before you perform any sort of repair or maintenance on your hard drive(s), you should make sure you’ve backed up any important data. It’s rare that a repair will actually cause you to lose data, but it’s possible. I hope you back up regularly and this isn’t an issue…you do back up regularly, right? (This is just the first of many nagging lectures about backing up your important data that I’ll be giving you in this chapter.)

Doctoring Disk Directories

When you stop to think about it, your hard drive is a pretty amazing thing; you have hundreds of thousands of files stored on it, yet you can access any of them at a moment’s notice. This ability to store and access files quickly is provided by your drive’s directory. The directory is like a card catalog or computer database at the library—the books are spread all over the building, but the catalog/data- base exists in a central location and lets you quickly figure out where each book is actually located. Your disk’s directory works similarly: It keeps track of where every file is located on your hard drive (specifically, the exact blocks—tiny storage spaces on the drive’s magnetic platters—where each file’s data is stored) so that your hard drive’s read/write heads can access that data on command. (I hope I didn’t date myself too much by using the term card catalog.)

Although the disk directory generally works well, it isn’t foolproof. Just like the old card catalogs could sometimes fall victim to lost cards, or books wouldn’t actually be where the catalog said they’d be, disk directories can develop errors and corruption so that files (or parts of files) aren’t where the directory says they should be. (Or, even worse, files are listed in the directory that no longer exist, and vice versa.) The worst cases of directory problems can result in lost data or even a computer that refuses to boot. Lesser instances can manifest themselves in sluggish system performance or problems opening applications or documents.

If you’re experiencing problems with your computer that can’t be traced to a bad preference file, or problems that affect all users, your first step should be to verify and/or repair your drive directory. However, minor directory corruption (which can eventually lead to bigger problems) often exhibits no symptoms at all, so you may never know you have it until you have it bad. So even if you aren’t experiencing problems, I recommend periodically running the same procedures as a form of routine main- tenance—this will often catch minor problems before they become serious. You can verify and repair your existing directory using tools provided with OS X, or you can rebuild your directory from scratch using third-party software.

Note

Each hard drive, drive partition, or other volume has its own directory. If you have multiple volumes, you’ll have to check and/or repair the directory on each separately.

Note that if you’re experiencing problems because of corrupt files or applications, rebuilding the disk directory won’t do you any good. The only solution is to reinstall the application or restore the file from a backup. (You do have a backup, don’t you?)

Apple’s Disk Utility

User Level | admin or any (see note below)
Affects | computer
Terminal | no

Apple’s officially supported method for verifying and repairing disk directories is to use Disk Utility’s Verify Disk and Repair Disk functions. I talked about Disk Utility in Chapter 7, but as a refresher, launch Disk Utility, select the desired volume from the list on the left, click the First Aid tab, and then click Verify Disk (to check the directory) or Repair Disk (to repair the directory). (I generally just use the Repair Disk button since it takes about the same amount of time as Verify, and if something’s wrong, I want it fixed.) What the Verify/Repair function of Disk Utility does is examine your hard drive to see whether or not what’s on the drive matches what the directory actually says is on the drive. If there are any discrepancies, it edits the directory accordingly.

The main drawback to using Disk Utility is that you can’t use it to verify or repair the directory of the volume from which OS X is booted. (This is actually true of most disk repair utilities.) In other words, to repair the startup drive, you need to boot from another OS X volume and then run Disk Utility, or you need to use the OS X Installer CD or DVD. To use the Installer CD or DVD, place the disc in your optical drive, restart your Mac, and hold the C key down as your computer reboots. You’ll eventually see the OS X Installer screen. Select Disk Utility from the Installer menu, and then choose your normal startup volume to repair it.

Note

You need admin access to use Disk Utility when booted into OS X. However, any user who can reboot your Mac can use Disk Utility from the OS X Installer CD/DVD.

It’s possible to run the same diagnostic and repair routines used by Disk Utility via single-user mode and fsck at startup; I’ll show you how next.

Disk Utility at Startup: fsck

User Level | any user who can restart
Affects | computer
Terminal | yes

If you don’t have your OS X Install disc handy and need to verify or repair your boot volume (usu- ally only necessary if you’re having problems that actually prevent you from booting into OS X at all), you can boot into single-user mode and run OS X’s fsck (filesystem consistency check) utility from the command line. (The fsck utility is actually run automatically after a system crash under OS X 10.2 and later, which is why there’s a long delay before you see the familiar boot panel after restarting.)

As I discussed in Chapter 3, if you hold down command+S as your Mac boots, you’ll eventually see a command-line interface; this is called single-user mode. If you then type /sbin/fsck -y <RETURN>, you’ll invoke the fsck utility, which, according to Apple, runs the exact same diagnosis and repair routines Disk Utility uses. (The -y option tells fsck to automatically answer "yes" to any suggested repairs; assuming you actually want to repair the drive, you should always include this option.) You’ll see some lines of text as the utility checks various aspects of your drive’s directory.

Note

If journaling is enabled on your drive—which it is, by default, in Mac OS X 10.3 or later—the need to run fsck is largely eliminated; see the sidebar "Journaling: Your Drive’s Personal Diary" for more information. If, after reading that sidebar, you really want to run fsck at startup on a journaled drive, you’ll need to instead use the command/sbin/fsck -fy <RETURN>. (The -f option forces fsck to perform repairs on a journaled drive.)

When fsck is finished, you’ll see one of two messages. If you’re told that your volume "appears to be OK," your drive is in good shape; type reboot <RETURN> and your Mac will restart and then boot normally. However, if you see the message "FILE SYSTEM WAS MODIFIED," it means that fsck found problems and attempted to repair them. In this case, you actually need to run fsck again, using the same command as above. The reason for this is that larger problems can sometimes conceal smaller problems, and vice versa. Once a problem is fixed, you want to check the disk again to make sure there aren’t any other lingering issues. Repeat the procedure until you get the message that everything is OK. When you’re done, type reboot <RETURN> to restart your Mac normally.

Note

By default, fsck verifies and repairs only the boot volume (the one chosen in the Startup Disk preferences pane prior to the last restart or shutdown). This is by design, since you can easily verify and repair non-boot volumes using Disk Utility when booted into OS X.

Note

If, after several runs, fsck reports the same error each time, the problem may be too severe for fsck to fix. You may need to use a third-party disk utility, such as one of those discussed in the next section, to repair or rebuild your directory.

Third-Party Directory Repair/Rebuilding

User Level: | depends on the utility
Affects | computer
Terminal | no

Disk Utility and its command-line counterpart fsck are powerful utilities, and many users never have a need for anything else; however, there are limits to what they can do. For example, there are times when a disk’s directory is so badly damaged that it can no longer be repaired. (This is generally what happens when Disk Utility tells you it can’t repair a problem or when fsck repeats the same error over and over.) In these situations, what you really need to do is discard your existing directory and build a new one from scratch. Although Apple’s built-in tools can’t do this, several commercial third-party utilities can.

Alsoft’s DiskWarrior (http://www.alsoft.com/DiskWarrior/index.html), Micromat’s Drive 10 and TechTool Pro 4 (http://www.micromat.com/), and Symantec’s Norton Utilities (http://www.symantec.com/nu/nu_mac/index.html) all provide some way of replacing your existing (and assumed to be problematic) directory with a new one. Norton Utilities will rebuild parts of the directory, which is better than trying to repair it if there are significant problems, but Drive 10, TechTool Pro 4, and DiskWarrior will completely rebuild the directory from the ground up (or from the disk up, so to speak). (In practice, Drive 10 and TechTool Pro 4 will only create a completely new directory if absolutely necessary; otherwise they’ll repair or rebuild just those parts of the directory that need it. DiskWarrior, on the other hand, always builds a new directory—that’s its forte.)

Which should you use? In this particular situation, I’m a big fan of DiskWarrior, mainly because it appears to do the most complete and comprehensive job of rebuilding disk directories—it even lets you compare the contents of the original directory with the new directory, including any file differences, before replacing the original. Alsoft also claims that DiskWarrior optimizes the directory so that it’s more efficient than the directories repaired or created by other utilities. In my own experience, I’ve seen DiskWarrior save data on a drive that was given up for dead—it was able to re-create a usable directory where no other utility could. If there’s a criticism of DiskWarrior, it’s that it only rebuilds disk directories whereas the other utilities mentioned in this section also have substantial additional functionality (which I’ll talk about later in the chapter); however, DiskWarrior is so good at what it does that it’s worth buying DiskWarrior and something else if you want those other features. (For a good discussion of the strengths and weaknesses of a number of OS X-compatible disk utilities, surf over to http://db.tidbits.com/getbits.acgi?tbart=07451.)

Tip

Just to be on the safe side, I boot from the DiskWarrior CD (or from another bootable volume) about once a month and rebuild the directories on all of my mounted volumes, especially my regular boot volume.

Start Sidebar
Journaling: Your Drive’s Personal Diary

Beginning with OS X 10.2.2, Apple included support in OS X for a new hard drive filesystem feature called journaling. The purpose of journaling, to paraphrase Apple, is to protect the integrity of your disk’s filesystem; it helps prevent your disk from getting into an inconsistent state and expedites disk repairs if your system fails.

When journaling is enabled, any change made to your hard drive (a file saved, a file deleted, a file moved, etc.) is recorded in a…well, a journal. The information in this journal includes the time of each change and the actual changes made. (The journal doesn’t keep track of each change forever. Once the journal reaches an upper size limit, new change records bump the oldest records out.)

The benefit of journaling is realized when your Mac crashes or, for whatever reason, you need to force a reboot. Normally, when your Mac shuts down, it cleans up after itself, including writing any cached data to disk and verifying disk directories. A crash or forced reboot often doesn’t allow these cleanup tasks to occur, so OS X tediously checks your boot drive—the entire thing—at the next startup for file and directory inconsistencies and other problems. With journaling enabled, your Mac can use the journal to restore the drive to a state that was known to be healthy. In addition, because your computer uses the journal to see which particular parts of the hard drive were most vulnerable to problems (those most recently accessed), it can concentrate on those at startup, instead of wasting time on sectors that haven’t been accessed in months; the obvious additional benefit is much faster reboot times. (You can read more about journaling at http://docs.info.apple.com/article.html?artnum=107249.)

If the benefits of journaling don’t seem to be very enticing to you, keep in mind that journaling was originally developed mainly for servers—computers with very large hard drives where data integrity is paramount and that can’t afford to be offline for long periods of time. In fact, journaling was originally officially supported only on Mac OS X Server. It wasn’t until OS X 10.3 that journaling was officially supported on the “client” version of OS X you use on your home computer. That being said, in my experience, you’ll have fewer hard drive problems over the long haul with journaling enabled, even on a home computer.

Journaling Caveats

Despite its obvious benefits, there are a few caveats to journaling. First, and most important from a data standpoint, with journaling enabled you shouldn’t use fsck to repair your hard drive at startup unless absolutely necessary (see "Journaling and fsck," below). Similarly, some disk utilities—at the time of this writing—haven’t been updated to work with journaling; make sure yours is before you use it. Second, the journal itself requires 4MB of contiguous hard drive space; those 4MB can’t be split up all over the drive. (However, given the size of today’s, and even yesterday’s, hard drives, chances are this won’t be a concern.) Third, recording every single change made to your hard drive doesn’t happen in a vacuum; it will affect your system’s performance to some degree. However, according to Apple, Mac OS X includes some tweaks that reduce the extent to which journaling slows down the system, so unless you have an older, much slower, Mac, you’re talking about a performance hit of approximately 1 percent. Finally, journaling is compatible only with HFS Plus; if your drive is formatted as UFS, you can’t enable journaling.

Enabling Journaling

Those caveats out of the way, if you’re still interested in enabling journaling, the good news is that your boot volume is most likely already journaled if you’re running OS X 10.3 or later. (Installing OS X 10.3 or later automatically enables journaling on the boot volume.) If you want to enable journaling on a non-boot volume, open Disk Utility, select the volume on the left, and then click the Enable Journaling button in the toolbar (or choose File Ø Enable Journaling). In addition, note that any volume erased or formatted using OS X 10.3’s Disk Utility is journaled by default.

If you’re running OS X 10.2, journaling is still available, but it takes a bit more effort to enable it. You can do so using Terminal, but an easier method is to use a third-party utility such as Xupport (http://www.computer-support.ch/Xupport/). Launch Xupport, and click the Settings button. In the Disk tab of the Settings panel, find the Disk Journaling section. From the pop-up menu, choose the mounted volume for which you want to enable journaling, and then click the Enable button (you’ll be asked for your password). To disable journaling for a volume, select the volume and then click the Disable button.

Journaling and fsck

I mentioned in the main text that journaling largely eliminates the need to run fsck at startup to repair minor disk problems. Since the journal should help Mac OS X fix many such problems, there’s usually no need to use fsck after a crash (a common troubleshooting technique on non-journaled startup volumes). In fact, Apple specifically recommends against it and points out that it can result in "benign" errors (http://docs.info.apple.com/article.html?artnum=107250).

That being said, the truth is that there are some disk problems that aren’t eliminated by journaling, and sometimes running fsck at startup can fix them. (Despite the previous Knowledge Base article, even Apple appears to acknowledge this, in a different, newer, article viewable at http://docs.info.apple.com/article.html?artnum=106214.) If your startup volume is journaled, but you’re having problems that appear to be caused by disk/directory corruption, it can’t hurt to try running fsck in single-user mode at startup; simply use the alternate command discussed in the main text. (The same goes for third-party disk utilities, which can still be useful on journaled drives.)

End Sidebar

Recovering Files

User Level | depends on the utility
Affects | computer
Terminal | no

Repairing your disk directories is all fine and dandy, but what if you’ve actually lost data? If your hard drive ever develops problems serious enough to cause you to lose files and data, you’re probably going to want to get them back, and it’s best to have the tools you’ll need for such a recovery beforehand. You need a utility that can access your drive’s data directly and recover files. (Although, of course, a good backup strategy will help you avoid such situations entirely.)

The first thing to note is that unless your hard drive actually fails (physically breaks), data is rarely actually lost. It’s often right there on your hard drive, but either (1) your directory is damaged, or (2) the file(s) have been deleted from the directory but not overwritten/erased (as explained in Chapter 13 when I discussed secure deletion of files). In the first case, fixing the directory as explained above may “find” the data; if not, you may need a utility, like those discussed in the next paragraph, that actually scours your drive to recover lost files. In the second case, a utility that recovers deleted files may be able to help; I discuss a few of those utilities in the next section.

If fixing your drive’s directory doesn’t work, Data Rescue X (http://www.prosoftengineering.com/products/data_rescue.php), TechTool Pro 4, and Norton Utilities all provide file recovery functionality. TechTool Pro and Norton Utilities use a method whereby they back up your disk directories at user-specified intervals. If you lose a file because of drive or directory problems, they can reference one of these past directories; if a file hasn’t been overwritten, they can rescue the file for you. (This approach is in some ways similar to OS X’s journaling feature; see the sidebar "Journaling: Your Drive’s Personal Diary" for details.)

Data Rescue, on the other hand, analyzes every single block of your drive and re-creates both directory and file information. It can recover data even if your directory is irreparably damaged or missing completely. I can tell you from personal experience—because of a disaster that claimed my main drive and both backups—that it works very well. Data Rescue was able to recover files when all other utilities failed.

Undeleting Deleted Data

User Level | depends on the utility
Affects | computer
Terminal | no

Being meticulous about keeping your drives and files healthy can help prevent data loss due to drive problems, but it can’t save you from yourself. If you’ve ever thrown away a file that you later real- ized you needed, only to find that you’d already emptied the Trash, you know exactly what I’m talking about. If you’re a frequent “accidental deleter,” a few utilities are available that could save your bacon. Norton Utilities, Tech Tool Pro 4, and Prosoft’s Data Recycler (http://www.prosoftengineering.com/products/data_recycler.php) all offer some degree of protection against accidental (or even purposeful) deletion. However, they take different approaches.

Norton Utilities’ UnErase function relies on the fact that data isn’t really erased when you empty the Trash but is in fact still there, intact, until another file is written to the same space on your drive. It scours your drive for data, and if it finds the file(s) you want to undelete, it recovers them. The downside to UnErase is that although it works great if you realize you need to retrieve a file immediately after deleting it, its ability to recover data is reduced dramatically the more time that elapses. This is because the more time that goes by, the more files are written to your hard drive, and thus the greater the chance that data will be written to the same parts of the hard drive on which your deleted file(s) reside.

Note

When you “undelete” data, you should always restore it to a drive other that the one from which you’re recovering it. If you try to restore it to the same drive, the newly restored file could accidentally overwrite some of the file data you’re trying to recover. Luckily, UnErase requires you to save the recovered file(s) to a different volume.

Data Recycler and TechTool Pro 4 take a different approach. Rather than counting on data to still be on the drive, they create a cache of deleted files. This cache resides in its own isolated space on the hard drive and keeps a copy of any files you’ve deleted. Files remain in the cache until enough new files are placed in the Trash to move older files out, causing the latter to be deleted permanently. (You can choose how big you want the cache of deleted files to be; how big of a cache you choose, combined with the size and number of files you delete, determine how much protection you have.) If you want to recover a deleted file, you simply open Data Recycler or TechTool, select the file from the list of “deleted” files, and then tell the utility to restore it.

Tip

In addition to files that you’ve thrown away yourself, Data Recycler can also restore files deleted by the OS (e.g., temporary files deleted after a system procedure is completed), files deleted from within applications such as iPhoto, and even files deleted from within Terminal using the rm command!

Keep in mind that the flip side of “Trash cache” utilities is that if you want to make sure a file is permanently deleted, you’ll need to manually tell the utility not to protect that file; TechTool Pro 4 and Data Recycler each do this a bit differently, but they both have the capacity. Or you can use one of the “secure deletion” utilities I mentioned in Chapter 13.

Warning

If you use a “secure delete” utility to permanently delete files, as described in Chapter 13, no utility will be able to recover these files. After all, that’s why you used the utility in the first place, right? Conversely, if you want to make sure that you securely delete a file when using a utility such as Data Recycler, you should use one of those “secure delete” utilities; the Finder’s Secure Empty Trash function may not be good enough.

Defragmenting Drives

User Level | depends on the utility
Affects | computer
Terminal | no

Even though you may keep your drives and directories error-free, that doesn’t necessarily mean they’re in tip-top shape. Fragmentation is a common issue that develops over time and can’t be fixed by rebuilding directories or examining hardware.

If you’re not familiar with the term fragmentation, it simply means that files are stored in pieces (fragments) about your hard drive, rather than in contiguous segments. Fragmentation generally isn’t a problem for new (or newly formatted) drives since most of the files—the operating system and stock files and applications—will usually be concentrated in one part of the drive; the rest of the drive will be free. New files can thus be written in contiguous chunks where the free space starts. However, as you delete files from your disk, small blocks of free space appear here and there. When you save a new file, or when a new file is created by the OS, instead of placing it in contiguous empty space away from existing files, in the interest of efficiency the OS tends to try to find space for it among existing files. However, if a block of contiguous free space isn’t available, the file will be split up into smaller segments, each of which is saved to smaller free spaces across the drive. (Likewise, if you add content to an existing file, chances are the saved file will be fragmented, as well.)

Over time, as you save, copy, and delete files to and from your disk, files become increasingly fragmented (Figure 14.1). This has several consequences. First, since files are broken up into many pieces, it takes more time and more disk action to access them than if they were in contiguous blocks. Second, because the disk directory for a highly fragmented volume is much more complex than one for a volume with low levels of fragmentation, the chances of directory problems are higher. Finally, because the virtual memory swap files used by Mac OS X for its advanced memory management are, at the most basic level, simply files on your hard drive, severe fragmentation causes swap files to be spread out across your drive, which can slow down system performance; conversely, the swap files themselves can exacerbate fragmentation. (This final issue is one of the arguments for moving your virtual memory swap files to an alternate drive; I discuss that topic in Appendix A.)

Click To expand
Figure 14.1: A graphical representation of disk fragmentation (courtesy of Drive 10)

Under Mac OS 9, fragmentation was a major issue that could severely impact your computer’s performance. OS X deals with disk fragmentation much better—and, to some extent, OS X 10.3 and later can even do some basic automatic defragmentation behind the scenes—but fragmentation can still affect system performance and can contribute to directory corruption (although the topic is subject to some debate). Fortunately, you can use many of the tools already discussed in this chapter to defragment your drive(s). Drive 10, TechTool Pro 4, and Norton Utilities (the latter via its Speed Disk feature) all have the ability to defragment drives, and all work fairly similarly. (DiskWarrior 2, for OS 9, comes with a utility called Plus Optimizer that will defragment OS X disks. Unfortunately, you must run it from OS 9 and thus can use it only on a Mac that will boot into OS 9.)

Warning

Before you use any utility to defragment a volume, be sure to verify and, if necessary, repair any problems on the volume first. Defragmenting a damaged volume can result in data loss. This is also another good argument for backing up— if the defragmentation procedure is interrupted for any reason, it’s possible to lose data or, in extreme cases, the entire volume.

For example, in Drive 10 you choose Services Ø Optimize Volume…, and a window pops up with a list of volumes. Choose the volume to be optimized, and click Analyze. (As with all optimization utilities, the volume to be optimized can’t be the boot volume, nor can it be the volume on which the utility is located—this is why most come with bootable CDs.) Drive 10 then presents a graphical representation of the volume’s contents (this is what I showed you in Figure 14.1). You can choose to optimize the volume based on File Fragments (which reunites each file’s pieces into a single contiguous block) or based on File and Disk Fragments (which additionally groups all files onto contiguous drive space, leaving as much contiguous free space as possible). The graph will actually be updated in real time as the drive is defragmented—a process that can take anywhere from a few minutes to a few hours, depending on the size of the drive and the degree of fragmentation. When it’s done, the graph will look like Figure 14.2—fragment-free.

Click To expand
Figure 14.2: The volume from Figure 14.1 after being defragmented
Note

Some users avoid defragmenting utilities and instead back up their entire volume, erase it, and then restore it from the backup, assuming this method will give them a drive that is no longer fragmented. However, this is only the case if the utility you use for backups copies files contiguously; many instead copy the drive back bit-for-bit. This procedure is safer from a data standpoint, but it means that your restored drive will be just as fragmented as it was before.

Organized Defragmenting: Optimizing

In addition to defragmenting your drive—making sure that each file resides on a contiguous section of the hard drive—several utilities allow you to optimize it. Optimization can take two forms. TechTool Pro, Drive 10 (via the File and Disk Fragments option), and DiskWarrior 2’s Plus Optimizer take the basic approach of simply relocating all files in one large contiguous block, leaving as much contiguous free space as possible.

Start Sidebar
Make Your Own Bootable Utility CD

Earlier in this chapter I mentioned that most disk utilities that modify the startup disk—to repair it, defragment it, or optimize it—require you to boot from another volume or from a special CD. Most of these utilities in fact come with their own bootable CD. Unfortunately, there are two problems with these CDs. The first is that as new Mac models are released, these “bootable” CDs are often outdated and no longer boot the newest hardware. The second is that each of these CDs generally includes only a single utility.

The solution to both problems is to create your own bootable OS X utility CD. In Chapter 7, I recommended the application BootCD (http://www.charlessoft.com/) as a way to do this. The steps to making such a CD are lengthy, so I can’t include them here, but the BootCD documentation is excellent and easy to follow. You can include all of your favorite disk utilities on your custom CD, and they’ll all be available to you at once when you boot from that CD.

End Sidebar

Norton Utilities’ Speed Disk component, on the other hand, bases its defragmentation routines on profiles. You select the profile that most closely resembles what the chosen volume will be used for (some examples are General Use, CD-ROM Mastering, and Recently Used Files), and Speed Disk will defragment the volume but will also move certain files to certain locations based on their use and type. For example, the Recently Used Files profile places those files that were most recently modified closest to free space, on the assumption that you (or the OS) are more likely to modify those files again—thus helping to slow future fragmentation. Most profiles also place system files in close proximity to each other, predicting that they’re more likely to be accessed closely in time.

Tip

Because of their slower speeds, CDs actually benefit from optimization much more than hard drives; Speed Disk’s CD-ROM Mastering profile is useful for optimizing CD images before burning.

I mentioned earlier that the value of defragmenting is often debated; the idea of optimization is even more of a hot topic. However, some people swear by it—I’ve even seen custom Speed Disk profiles, designed specifically to optimize OS X boot volumes, floating around the Internet. I defragmented my boot volume and definitely noticed an increase in system performance. (Granted, I’d been using it for two years without defragmenting it; you may not see much of a difference if it’s only been a few months.) However, I’ve never “optimized” it, so I can’t tell you how much it helps as compared to defragmentation.

Note

If you’re curious about Apple’s stance on defragmenting and optimizing, you can read the following Knowledge Base articles: http://docs.info.apple.com/article.html?artnum=17933 and http://docs.info.apple.com/article.html?artnum=25668.

Disk Drive Diagnosis

User Level | depends on the utility
Affects | computer
Terminal | no

Although it’s certainly true that today’s hard drives are more reliable than ever before, that doesn’t mean they’re foolproof. Hard drives are susceptible to both environmental factors and, occasionally, manufacturing defects. So, ideally, in addition to periodically checking your disk directories, you’ll want to make sure your hard drive itself is working right.

There are three approaches to hard drive testing. The first, used by Norton Utilities’ Disk Doctor, TechTool Pro 4, and Drive 10, is to scan every single block on your drive to make sure each is working properly. If the utility finds a bad block or sector, it disables that particular bit of the hard drive so that it will never again be used for storing data. Bad blocks are actually a fairly common problem, but once a bad block or sector is deactivated, your drive should operate perfectly.

The second method, used by TechTool Pro 4 and Drive 10, is to perform a battery of hardware tests on the drive that checks everything from the correct power supply voltage to the ability of the drive to read and write to both the drive’s disk platters and its RAM buffer. If a problem is found, you’re notified of what that problem is and what can be done about it.

Finally, many recent EIDE hard drives—which includes all those used in today’s Macs—include a system called Self-Monitoring Analysis & Reporting Technology (SMART). SMART is a system through which the hard drive communicates with the host computer and provides information about the operating state of the drive. The SMART system monitors several aspects of the drive’s performance and compares them with expected values for that particular drive model to determine if the drive is operating as it should. If a problem or anomaly is detected, the SMART system can produce an alert. Since most hard drive problems develop gradually rather than suddenly, such an alert can give you advance warning and a chance to save important data (and then have the drive repaired or replaced).

Unfortunately, the SMART system can’t notify you of errors on its own; it requires software that communicates with the drive and reports any warnings to the user. Currently, DiskWarrior, Drive 10, and TechTool Pro 4 support SMART. (If you’re using one of these utilities, you can check your manual for information on how a SMART warning would be reported to you.) In addition, in OS X 10.3 and later, Disk Utility itself provides limited SMART monitoring functionality. When you select a drive in Disk Utility, the drive summary at the bottom of the window shows a line that reads “S.M.A.R.T. status” and then provides the current status of the drive—“Verified” or “About to Fail.” (Another caveat of SMART monitoring is that it works only with IDE drives that are connected via an IDE connection; drives that use IDE bridges, such as external FireWire or USB drives, can’t be monitored using SMART-compatible software.)

In reality, hard drive failures are rare; however, when they happen, the aftermath can be fairly disastrous (in terms of data loss). Good backups are your best protection, but you can take advantage of tools such as those discussed here to at least get some advance notice of an impending failure.

Data Despair?

I’ve talked about all the ways in which you can keep your disk directories, files, and drives healthy, but what about worst-case scenarios? What if you drop your PowerBook onto concrete, and the hard drive no longer responds? What if your G4 tower is caught in an office fire (or drowned by the fire hoses trying to put out the fire)? What if a lightning storm fries your computer and your hard drive(s) with it? What if the hard drive just goes kaput on its own? These are pretty horrible things to think about, but the truth is that they can and do happen. If you find yourself in a situation where an important hard drive doesn’t respond to the utilities mentioned here, and you don’t have a proper backup, it’s time to get out your checkbook—your only choice may be to spend some dough and have your data recovered by a professional data recovery service. These companies actually take your drive apart and examine the data in a sterile lab, platter by platter. They’re not cheap, but if you’re using their services, your data must be worth something.

Unfortunately, I’ve found myself in such a situation, thanks to an incident that claimed both my main drive and its backups. As I mentioned earlier in this chapter, after the disaster I was able to recover some data using Data Rescue X. However, I was unable to recover everything, so I put myself at the mercy of the most reputable name in the business, DriveSavers (http://drivesavers.com/). They came through with flying colors in an impressively short amount of time.

Note

If you need to recover data after a disaster (manmade or otherwise), I’m going to assume that you have a proper backup, but that by some horrible twist of fate your backup was damaged or lost or stolen or that there’s some other explanation as to why you don’t have a good backup. If you don’t have a recent backup, you must read the part of this chapter dedicated to the topic.


Maintenance Magic

Keeping your drive(s) healthy is an obvious form of Mac maintenance. However, OS X presents several other “opportunities” for maintenance that many Mac users have never encountered before. (How’d you like that use of euphemism?) Here are a few you should know about.

Periodic Permissions Patching

User Level | admin
Affects | computer
Terminal | no

I talked about repairing permissions and privileges in Chapter 1 as a way to fix permissions-related problems. In Chapter 4, I also recommended repairing permissions before and after installing major system updates. However, in my experience, permissions get screwed up on their own fairly regularly. Most of the time the consequences are extremely minor; however, I find it useful to run Disk Utility’s Repair Disk Permissions function on my startup drive on a regular basis. (I run it once every week or two.) I can’t guarantee any results, but I can tell you that I’ve seen fewer permissions-related problems, and fewer problems in general, since I’ve made this one of my regular routines.

Note

I showed you how to run Repair Disk Permissions in Chapter 1, but, if you’re interested, I’ll show you how to make it run automatically in the background later in this chapter under “Automating Admin Actions.”

Running Routines (Unix Routines, That Is)

User Level | admin
Affects | computer
Terminal | possibly

Because OS X is based on Unix, it still exhibits a few remnants of classic Unix behavior. One of these is its reliance on “cleanup” scripts. Unix operating systems maintain a number of activity logs (discussed later in this chapter), databases, and temporary files that need to be cleaned out and/or updated periodically. To take care of these tasks, Unix computers (including yours, running OS X) use three scripts, called daily, weekly, and monthly, to perform these actions. These scripts remove unnecessary temporary files, archive or delete old log files, and update databases (such as the locate database I talked about in Chapter 5). They run, as you might guess, daily, weekly, and monthly, respectively.

Unfortunately, on many Macs these scripts never get run. Because Unix computers have historically been used as servers or number-crunching workstations, system administrators didn’t want to run these scripts—which can take a good deal of time and system resources—during the day when users were most likely to be using the computer. So, since most Unix computers were left running 24/ 7, they took advantage of Unix’s cron automation utility to schedule the execution of these scripts at times when computers would least likely be in use. (I’ll talk more about cron later in this chapter.) Over time, these execution times became standardized across entire distributions of Unix; in OS X, the daily script is scheduled to run every morning at 3:15 A.M., the weekly script is scheduled for 4:30 A.M. Saturday mornings, and the monthly script will be run at 5:30 A.M. on the first day of each month.

The problem is that most Mac users don’t leave their computers on all night, and if your computer isn’t running (and awake), the scripts don’t get run—so your temp files don’t get deleted, your log files grow larger, and your databases aren’t updated. Although this isn’t a disaster, your log and temp files can grow quite large over time, and if you actually use any of the databases in question (such as the locate database), you won’t be using updated versions. If you shut your computer down at night, or put it to sleep, here’s how to get these scripts to run.

Note

If you do leave your computer on (and awake) at night, you may as well skip to the next section right now because you’re set.

There are actually a few simple solutions to this predicament. The first is that you can occasionally leave your Mac running all night so that the scripts will run. For example, if you leave your Mac on every Friday night/Saturday morning, and the last night/first morning of every month, your monthly and weekly scripts will run as scheduled, and the daily script will at least be run once per week, which is sufficient for most users.

The second approach is to use utility such as the freeware MacJanitor (http://personalpages.tds.net/~brian_hill/macjanitor.html) or the shareware TinkerTool System (http://www.bresink.com/osx/index.html) or Xupport (mentioned earlier in this chapter) to run any or all of the scripts at your leisure. For example, when you launch MacJanitor and provide your admin password, you can execute any of the scripts by clicking its button in the toolbar, or simply click the All Tasks button to run all three (Figure 14.3). The bottom of the window displays the script’s log output so you can see what’s happening.

Figure 14.3: MacJanitor lets you manually execute OS X’s periodic maintenance scripts.
Tip

If you’re feeling adventurous, you can do the same thing as MacJanitor, TinkerTool System, and Xupport using Terminal. Simply type sudo periodic script <RETURN>, where script is daily, weekly, or monthly. After providing your admin password, the script will run, and you can feel good knowing that you used the command line to run the script just like they did in the old days.

The only downside to using a tool such as MacJanitor (or Terminal) is that you have to remember to use it. If automating the process is worth a few bucks to you, check out the shareware Macaroni (http://www.atomicbird.com/). Macaroni runs as a preference pane and provides two helpful features. First, each time you start up or wake your Mac, Macaroni checks each script’s schedule, and then checks to see if the script was actually run on schedule. If a script didn’t run when it was supposed to, Macaroni runs it. This way your maintenance scripts never get too far behind schedule. The second feature is that you can actually change the schedule (by day) on which the scripts are run. For example, you can choose to have the daily script run every other day instead of daily. Or you can change the day of the week or month on which the weekly or monthly script (respectively) should be run. As a bonus, Macaroni can even schedule other shell scripts to be run at certain intervals and can also run OS X’s Repair Disk Permissions feature on the schedule you choose.

If you’re curious as to exactly what the daily, weekly, and monthly scripts actually do, they’re located at /etc/periodic/daily/500.daily, /etc/periodic/weekly/500.weekly, and /etc/periodic/monthly/500.monthly. You’ll probably find the code to be little more than gobbledygook unless you’re a Unix pro, but the comments (preceded by #) are often fairly descriptive. You can also download MacJanitor (mentioned above); it comes with a text file called What Is It Doing? that includes a brief summary of each script in plain English. Finally, each script produces its own log file (daily.out, weekly.out, and monthly.out), stored in /var/log.

Tip

If you have your own shell scripts that you’d like run daily, weekly, or monthly, you can actually place them in /etc/periodic/daily, /etc/periodic/weekly, or /etc/periodic/monthly, respectively. They’ll be run immediately after the standard cleanup scripts—the last action of each script is to check the enclosing folder for other scripts to run. (I’ll talk more about shell scripts in the next chapter.)

Cache Cleaning

User Level | any or admin
Affects | individual user or computer
Terminal | no

Remember back in Chapter 2 when I told you that many problems with the System Preferences application (a freeze at launch, multiple instances of the same preference pane, etc.) can be fixed by throwing away its cache file? This issue of corrupt cache files isn’t isolated to System Preferences. The truth is that cache files are used quite frequently in OS X as a way to store frequently accessed data and, as a result, can impact a lot of things.

For example, one of the most common cache-related issues under OS X 10.2 is a situation where you can no longer drag files or folders in the Finder. No matter how hard you try, they appear to be permanently glued in place. One solution is to delete certain cache files from your ~/Library/Caches directory. A number of other problems in OS X can similarly be solved by discarding files in that folder, or in several other local- and system-level cache folders (e.g., /Library/Caches, /System/Library/Caches, and /System/Library/Extensions.kextcache).

In addition to occasionally contributing to problems, some cache files grow larger and larger over time, taking up more and more disk space. (I recently checked my ~/Library/Caches directory and found that it was more than 200MB in size.) If you’re a neat freak, you may enjoy throwing out unnecessary cache files that are just cluttering your hard drive.

Although you could clear out many of these files manually, there are two utilities that do an excellent job of automating the process: the donationware Dragster (http://ifthensoft.com/) and the shareware Panther Cache Cleaner (http://www.northernsoftworks.com/). Dragster is specifically designed to fix the bug described above where you can’t drag items in the Finder. It deletes a specific list of cache files (and a few preferences files, such as the Finder preferences) that have been directly linked to the glitch. I personally experienced the "no drag" problem twice while using OS X 10.2, and both times Dragster solved the problem. In addition, at your request it can also delete several other Finder- and Dock-related files that can contribute to Finder problems, such as the invisible .DS_store files that exist in every folder on your hard drive. (These files contain your individual window preferences; when one or more is corrupt, you can experience odd window behavior.)

Panther Cache Cleaner (PCC), on the other hand, can also fix the aforementioned Finder bug, but it also deletes many other files that may be related to a broader range of system issues. However, because it deletes more files, some of which may include important information, PCC’s developer recommends that you first try other troubleshooting options, such as running Disk First Aid to repair your disk and permissions. If you decide to use PCC, you can choose the Light Cleaning option (from the Caches tab) first; if that doesn’t work, a Deep Cleaning option deletes a more extensive list of files. You can also choose to have PCC clean (read: delete) files in just your user cache directory, the local cache, the System cache, and/or other users’ cache directories.

Note

Both Dragster and Panther Cache Cleaner require a restart after doing their job, so be sure to save any documents before running either utility. In addition, both also require an admin password if you want them to remove any system- or local-level files.

In addition to its “cleaning” functionality, Panther Cache Cleaner also has a few other features. Although they’re unrelated, having them in easy reach can be convenient. I already talked about PCC’s Login Items feature in Chapter 3. In addition, PCC will allow you to manually run OS X’s three maintenance scripts, as discussed in the previous section, and can run the Repair Disk Permissions routines without having to open Disk Utility. (I show you how to automate this in the next section.) It can also force the Trash to empty or force-delete a file or folder if the item is being stubborn. Finally, PCC can even “optimize” your Internet connection and file cache; see the documentation for more details.

Tip

I tend to manually empty the three /Caches directories every month or so and turn to Dragster or PCC only when I experience strange Finder or application behavior that I can’t fix by throwing away preference files.

If you’re still running OS X 10.1.x, some of the problems described above can be attributed to a few other files in addition to cache files. These files are located in ~/Library/Preferences, and all begin with .LS. Both utilities described above will also remove these files for you.

Saving Space

User Level | depends on files to be deleted
Affects | computer
Terminal | probably not

This is probably the easiest “maintenance” task of all: Make sure your hard drive has a good amount of free space available. Mac OS X uses hard drive space to store temporary data and virtual memory swap files. In addition, some applications also create temporary files (often called scratch files) as you work with data. If your hard drive gets low on free space, you can experience sluggish performance, or even error messages stating that there’s no room on your drive. In extreme cases, you may be prevented from saving changes to documents, or your Mac may simply freezeup, forcing a restart.

Making sure you have sufficient free space on your startup volume can avoid such problems. To see how much free space remains, select your startup volume in the Finder and choose File Ø Get Info; the number next to Available is the available drive space. In generally, I recommend keeping at least 15 percent of your drive empty. If you use Adobe Photoshop, iMovie, iDVD, or other applications that work with extremely large files, increase that amount by about three times the size of the largest files with which you work. (Unfortunately, if you’re using an older Mac with a small hard drive, this might mean that you need to buy a larger hard drive. The good news is that OS X likes big hard drives, so you’ll be better off in the long run anyway.)

If you need to get rid of files because you’re running out of space, try deleting applications you never use. You may also want to consider deleting printer files and unused language support, as discussed in Chapter 4. Finally, you can always take documents or other files that you rarely access and burn them to CD or DVD; you can then delete them to free up space.


Admin Artistry

In addition to the maintenance-related tasks I’ve been talking about, I’d like to point out a few other tips that are administrator-related—specifically, how to schedule events and actions, how to adjust application priorities, and how to better work with OS X’s log files.

Automating Admin Actions

User Level | normal or admin
Affects | individual user or computer
Terminal | possibly

I mentioned earlier in the chapter that OS X’s cleanup scripts are run by the Unix utility cron. This utility runs in the background whenever your computer is running. Every minute, it checks schedules called crontabs (short for cron tables) to see if any commands or scripts (called cron jobs) are supposed to be run at that time; if it finds one (or more), it runs them. Although most users don’t even realize that cron exists, now that you do, you can use it to your advantage.

In theory, cron can execute only commands that you would type into Terminal; however, since you can run complex shell scripts from the command line, cron can launch them, too. In addition, OS X includes a special Terminal command, open, that allows you to open any file or document as if you’d double-clicked it in the Finder. This adds a whole ’nother level of power to the cron utility—Apple- Scripts can be saved as stand-alone applications, and can themselves run shell scripts, so the cron utility in OS X can schedule and automate pretty much anything you want to do in the Finder, in scriptable applications, and in Terminal (the shell)—or any combination of the three. I’m not going to get into super-complex shell/AppleScript automation here, but later in this section I do give you a few (simple) examples of how you might take advantage of cron on your own computer.

Because cron is a command-line program, its syntax can get pretty messy; however, like many other command-line applications in OS X, someone has put a nice face on it and made it easy to use. CronniX (http://www.koch-schmidt.de/cronnix/) is a donationware utility that lets you edit both system- and user-level crontabs.

Note

In general, you only want to edit the system’s crontab if you need to execute a command that requires root access. For all other uses, you should edit your own user-level crontab. If you’re curious, the system’s crontab is actually located at /etc/crontab; individual user crontabs are located in /var/cron.

By choosing File Ø Open System Crontab, you can view and edit the main system-level crontab (you’ll need to provide your admin password to edit it). Alternatively, by choosing File Ø Open for User… and typing in a username, you can view and edit any user-level crontab (to edit another user’s crontab, you’ll need to provide your admin password).

Unless another utility has scheduled a cron job (called tasks in CronniX), your own user-level crontab is likely to be empty. To see what a crontab entry looks like, open your own crontab, and then choose File Ø New Default Task. CronniX will create a new sample task that displays the text Happy New Year! (Figure 14.4).

Click To expand
Figure 14.4: A sample crontab entry in CronniX

What this entry says is that at the time 0:00 (cron uses 24-hour time, so 0:00 is midnight) on the first day of the first month, the text Happy New Year! should be "displayed." (I put displayed in quotes because what really happens is that an e-mail message is sent to the local mail spool, which on most Macs isn’t going to do anything you’ll ever see. But at least it’s a good example for seeing the format of a crontab entry in CronniX.) You can double-click any field to edit its value; when you’re finished editing, click the Save button in the toolbar.

Tip

CronniX has an excellent online manual that I highly recommend reading at http://www.koch-schmidt.de/cronnix/docs/index.html.

If you’re curious what a system-level crontab actually looks like, open the file /etc/crontab in a text editor (or type more /etc/crontab <RETURN> in Terminal, which is a bit easier). At the very least, it will contain three scheduled events:

15 3 * * * root periodic daily
30 4 * * 6 root periodic weekly
30 5 1 * * root periodic monthly

If the names of the commands look familiar, it’s because each of these lines is the schedule for one of the cleaning scripts I talked about earlier in the chapter; the periodic command runs scripts located in the daily, weekly, and monthly folders I pointed out. In fact, if you look at the first five columns, you’ll see that they correspond to the minute, hour, day of the month, month, and day of the week fields in CronniX and, in the context of those fields, correspond to the days and times I told you that these scripts are scheduled to run.

Here are a couple of examples of ways to use CronniX and cron that you might find useful.

Tip

As I previously mentioned, if your computer is asleep (or off), cron doesn’t run, nor does it check to see if it "missed" any scheduled events when your computer wakes up or is started up. So in order for a cron job to be executed, your computer must be running and awake at the job’s scheduled execution time. (With respect to OS X’s cleanup scripts, which don’t get run if you turn your Mac off at night, if you’re feeling adventurous you can use CronniX to edit their crontab entries—via the system crontab—so that they run during the day instead.)

Getting a Daily Report of Free Space

This is very simple example that shows you how you can run a command-line program using cron and have its output saved to a text file. It may not be useful to you, but it’s good for demonstration purposes. Suppose that you do a lot of work with big files, and you want to check how much room you have on your hard drive each morning. You could manually get info on the drive in the Finder, but wouldn’t it be nice if your computer checked for you and put the results in a text file on your Desktop? Let’s say, just for the sake of argument, that you think this is a neat idea. Here’s how you can do it:

  1. Launch CronniX, choose File Ø Open for User…, and click Default. (You could also enter your own username and click Open.)

  2. Choose File Ø New Task. You’ll be presented with a task editing sheet (Figure 14.5).

  3. Choose the time you want the disk info to be gathered—if you want it to happen every day, check the boxes next to “Day of month” and “Month” (this tells cron you don’t care what day of the month or month it is) and check the Any box next to "Day of week." (If you only wanted a report on weekdays, you could instead check the boxes for Mo through Fr.) In my example in Figure 14.5, I told cron to execute the command every day at 9 A.M.

    Figure 14.5: Creating a new cron task in CronniX

  4. In the Command field, type /usr/sbin/diskutil info / > /Users/username/Desktop/ filename.txt, where username is your username and filename is the name you want the output file saved as. The first part of this command, /usr/sbin/diskutil, is the path to the diskutil program (the same one you’d be using if you typed diskutil in Terminal). The info argument tells diskutil to get info on the drive specified (/ means the boot volume). The > character tells the command to write its output to a file. Finally, the last part of the command specifies the name of the output file and where it should be saved.

  5. Make sure the “Prepend ‘/usr/bin/open’” box is not checked.

  6. Click New to create the new task.

  7. Click the Save button in the toolbar.

Now every morning at 9 A.M. (or the days/time you specified), a new text file will be created on your Desktop that contains information about the boot volume, including the amount of free space remaining. This is admittedly a very simple event, but it shows you the kind of things that you can do with cron.

Repairing Permissions Periodically

Earlier in the chapter I recommended periodically running OS X’s Repair Disk Permissions function to keep things running smoothly. You can actually use a simple cron job to run Repair Disk Permissions automatically; you can even have a report of the repair saved. Here are the steps involved:

  1. Open the System crontab in CronniX, and then click the New button to create a new task.

  2. In the Schedule section of the task window, select the times and days you want the script to be run. I personally have this script set to run once per week, which may be overkill. You can instead choose to run it once a month by checking the box next to Month (which tells cron to run the script regardless of the month) and entering a date (1–31) in the field to the right. (I recommend using 1-28 since using a date of 29, 30, or 31 means that the script won’t run in months with fewer days.) In the Hour and Minute fields, enter a time of day that your computer is likely to be running (hours are in 24-hour format).

  3. In the Command field, type the following command (all on one line):

    diskutil repairPermissions / >> /Users/username/Desktop/filename.txt

    where username is your short username and filename is the name you want used for the repair report. The first part of the command, diskutil repairPermissions, is the actual repair command. The / tells the command to repair permissions on the boot volume. The >> characters tell diskutil to append the report of repairs to a file. Finally, the last part of the command specifies the name of the report file and where it should be saved.

  4. Make sure the “Prepend ‘/usr/bin/open’” box is unchecked, and then click the New button to create the new task.

  5. Click the Save toolbar item to save your changes to the System Crontab; provide your admin password when prompted.

From now on, Disk Utility’s Repair Disk Permissions function will run automatically—and “invisibly”—at the time(s) you specified.

Opening Applications and Running AppleScripts Using Cron

If instead of running Terminal commands, you want to use cron to open an application or run an AppleScript, the procedure is slightly different, but still quite easy. When you create a new event in CronniX, instead of typing in a Terminal command, check the box next to "Prepend ‘/usr/bin/open’" and then click the Browse… button. In the Open dialog that appears, navigate to the application or AppleScript that you want to be opened by the crontab entry, and then click Insert. The rest of the procedure is identical to those described above.

Adjusting Application Priorities

User Level | normal or admin
Affects | individual user or computer
Terminal | no

One of the things that make OS X so much more powerful than OS 9 is that OS X doesn’t allow a single application to monopolize your computer. The downside to this is that sometimes you want a single application to be able to monopolize your computer. For example, Microsoft’s Virtual PC (http://www.microsoft.com/mac/) emulates a complete Windows PC on your Mac, which takes a lot of processing power. To get the best performance possible, you want Virtual PC to be able to use as much of the processor as possible.

Unix allows an admin user to change application priorities—via the renice command—so that applications that are given higher priority can take more than their normal share of system resources, and those given lower priority have to wait in line, so to speak, until applications with higher priorities can spare some of those resources. Unfortunately, changing application priorities in Terminal is a bit messy; on the few occasions when I need to work with priorities, I use a third-party utility such as the freeware ProcessWizard (http://www.lachoseinteractive.net/) or the shareware Renicer (http://www.northernsoftworks.com/).

ProcessWizard is probably a better choice if you want to manually assign higher or lower priorities to specific applications. It sits in the menu bar, and when you click its icon, a sheet drops down listing all applications (or, via the pop-up menu in that sheet, background apps, user-level system processes, or non-user system processes) (Figure 14.6). By dragging the slider next to a process to the right, you’re increasing its priority; if you drag a slider to the left, that application’s priority is reduced. (After changing a priority, you’re asked for your admin password.)

Figure 14.6: ProcessWizard lets you “renice” any running process.
Note

Process/application priorities can range from –20 to 20, with zero being the default value for every process when it first launches.

Renicer works a bit differently than ProcessWizard, and is what you should use if you want behavior similar to the way OS 9 used to work—that is, for the frontmost application to have the highest priority. When you launch Renicer and provide your admin password, it sits in the background and automatically increases the priority of the frontmost application in order to increase its performance relative to other processes. When you switch to a different application, the prior application’s priority is reset to zero, and the new frontmost application is “reniced” to a higher priority, and so on—the frontmost application will always have the highest priority. You can also specify particular applications so that they always get high priority, even when they’re in the background (or, conversely, so that they always get low priority, even when they’re in the foreground). Finally, you can also choose the priority value given to the frontmost app, from 0 to 20, and the value given to “low priority” processes, from –20 to 0.

Looking Over Log Files

User Level | any
Affects | NA
Terminal | no

I mentioned in Chapter 7 that many applications, as well as OS X itself, generate logs of their activity. Although most of the time log files aren’t too useful for the average user, if you’re experiencing problems they sometimes provide information that can help you (or the developer of an application) track down the cause.

As I mentioned in Chapter 7, you can use OS X’s Console application, as well as System Profiler, to view log files. However, if you want a better interface (trust me, if you ever need to actually read these things, you want a better interface), the shareware LogMaster (http://www.brightlightsoftware.com/

) is a significant improvement over Console or System Profiler (Figure 14.7). Logs are organized in groups, represented by icons (System, Apache, CUPS, Samba, CrashReporter, and User); within each group of logs, the pop-up menus to the right allow you to select a particular log, or even an archive (older version) of that log, to view. (You can add logs to be monitored via LogMaster’s preferences dialog; these custom logs will be added to the User Logs group.)

Click To expand
Figure 14.7: LogMaster provides advanced log viewing features.

Once you’re viewing a log, you can choose to filter lines containing (or not containing) particular strings of text using the “Show/Hide lines” pop-up menu and text field. In addition, the Find String text field allows you to search for a text string; any lines in the log that contain that string will be highlighted. You can also select individual or multiple lines and then copy them for pasting into an e-mail or text document, or you can choose File Ø Mail Log… (or Mail Selection…) to e-mail the entire log (or just the highlighted portion).

Finally, for advanced users, LogMaster offers features such as listen daemons that listen to a particular port and log incoming traffic, a Web server that allows you to view logs in any Web browser, and automated actions that are triggered when a specific string is detected in a new log entry.


Backup Basics

A lot of bad things can happen to your computer—hard drive problems, system crashes, theft, power surges, and physical damage are just a few of the kinds of incidents that can change your computer from a useful tool to a pile of plastic and silicon (or, in the case of theft, an empty space on your desk) in a matter of seconds. However, as bad as such events are, for many (if not most) people, the bigger loss is the actual data that was on the computer. After all, computers may be expensive to replace, but no amount of money can replace your data or the time and effort you spent creating it.

An old (but appropriate) saying in computers goes something like this: “There are two kinds of people—those who have lost data, and those who will lose data.” If you use computers long enough, you’ll fall victim to an event like those described above. Or you’ll find yourself a victim of your own missteps. (I’ll admit to accidentally deleting a folder of documents that shouldn’t have been deleted.) The only way you can prevent such an event from being truly disastrous is to back up your data. In fact, I’ll put it bluntly: You can master every topic in this book, but if you’re not backing up important data, you’re not a “power user.”

The subject of data backups is a complex one, and there are scores of ways in which you can go about backing up. There are also many different utilities available to help you. Although I could walk you through the steps needed to perform a certain type of backup, that may not be the best method for you. Because my space is limited, I’m instead going to talk about some of the basics of backing up, including general strategies and tips. If you’re not schooled in the art of backups, the ideas discussed here should at least get you thinking about what you need to do to keep your data safe.

I’ll also mention some of the tools that are out there to help you make backing up less of a hassle and a couple of utilities that will allow you to synchronize volumes or directories. (Synchronization is technically a form of backup, but it’s also a matter of convenience if you just want to keep the same data on two computers or volumes.)

Backups 101

Everyone has heard about the concept of “backing up data,” but few people really take a step back and think about the process methodically. Here are some things to consider when deciding on a backup strategy.

How Much/What to Back Up

How much of your data you should back up depends on two things: which files are vital and how much time you’re willing to spend getting your computer back up and running. The first criterion is simple—if you need a document and it would be difficult, impossible, or impractical to re-create, make sure it gets backed up. This is a good argument for making sure that you at least back up your ~/Documents directory on a regular basis (and for making sure that you store your documents and personal files in that directory). If anything ever goes wrong, at the very least you’ll still have your personal files, documents, etc.

The second criterion, however, is one that many people never consider—in addition to losing documents, a computer disaster can result in the loss of applications, third-party system add-ons, preference files, browser bookmarks, and many other types of data that may not be “vital,” but are nevertheless important to your everyday work. If they don’t get backed up and your hard drive dies, is stolen, or has to be rebuilt for any other reason, anything that wasn’t backed up is going to have to be manually reinstalled (in the case of applications and system add-ons) and/or set up (application preferences, bookmarks, system settings, etc.). If you can’t afford to spend the kind of time necessary to restore your computer to its “working” status from scratch, you should consider backing up more than just your Documents folder.

In my opinion, in addition to your Documents folder, you should always back up ~/Library , since your Library folder contains all of your personal settings and support files. For example, your Address Book database, iCal calendars, personal system add-ons, OS X Favorites, Keychain file, browser book- marks, application settings, and possibly even your e-mail (if you use Apple’s Mail) are stored in your personal Library folder. Backing up this folder will save you a lot of work if you ever have to start over.

Warning

I mentioned in Chapter 5 that OS X uses invisible files quite frequently; unfortunately, these files don’t get copied when your drag a folder between volumes, meaning that you can’t simply back up your Library folder (or an entire OS X volume) using drag-and-drop in the Finder as you could in OS 9. You need to use a utility that is OS X–savvy (or Terminal’s ditto -rsrc command).

Finally, if you want to be sure to get all of your personal data, including your iPhoto databases, iTunes music, the contents of your Desktop folder, your personal website files, etc., you need to back up your entire user folder. The only drawback is that photos and music take up a lot of space. But, again, it gets back to how much work you’re willing to do to get back to your original state after a disaster. If you can’t spare the hours it took you to rip your music from CD to MP3 for iTunes, you should back up your iTunes Music folder (inside ~/Music); likewise for your iPhoto database of photos (inside ~/Pictures).

Tip

The discussion here makes a good argument for always storing important documents inside the folders you regularly back up. It also makes a good case for installing system add-ons at the user level, rather than the system level, since a good backup of user folders means you won’t have to reinstall these add-ons in case you ever have to rebuild your hard drive.

If you’re an admin user, you have a few additional things to consider. First, are you responsible for making sure other users’ data is backed up? If so, you’ll want to back up other user folders, as well. Second, do you have the time to manually reinstall every application? If not, consider backing up the Applications folder. Finally, do you have the time to manually reconfigure the entire system? In the worst case scenario, your computer will need to be set up from scratch, meaning you’ll have to install OS X, create all user accounts, restore applications and user data, edit preferences and possibly configuration files, and so on. Personally, I don’t have time for this—my Mac is my livelihood—so I actually back up my entire system.

Tip

Another benefit of having a complete system backup is that if your computer ever starts having serious problems due to hard drive issues, instead of spending time tracking down problems, you have the option of simply erasing the hard drive and restoring everything from the last “healthy” backup.

How Often to Back Up

The question of how much time you can afford to lose is also relevant when you’re deciding how often to back up. To put it another way, in the event of a data disaster, you’ll have to manually re-create any work you completed between the time of the disaster and the time of your last backup. If you only back up once a week, that means you could conceivably lose up to a week’s worth of work. If you back up once a day, the most you could lose is a day’s work. (If your work is especially important or time- sensitive, you can—and should—back up documents you’re working on even more frequently.)

Local or Removable Backups?

How “safe” your backups are depends largely on where they reside. Here are a few examples, in increasing order of safety:

  • If you just want to make sure you have an extra copy of a document or documents in case you change your mind about edits or modifications, simply making copies on your hard drive is sufficient. However, this is more of a “convenience” backup than a true backup procedure since it won’t help you if your hard drive dies—you’ll lose all of your copies along with the originals.

  • If you have a second internal hard drive, you can copy or (using a backup utility such as those mentioned later in the chapter) archive files to the extra hard drive. This provides a convenient and fairly reliable backup since the second drive should still work fine even if your primary hard drive dies. However, such a backup won’t do you much good in the event of theft or disaster (such as a fire or severe power surge) since the second hard drive will fall victim to the same fate as the primary drive.

    Warning

    Disk partitions that reside on the same physical hard drive aren’t a good choice for backups since a hard drive failure will generally render all partitions on that drive equally inoperable.

  • If your main reason for backing up files isn’t necessarily safety from theft or disaster, but rather to have an immediately accessible copy of all data in case of drive failure, you can use two identically sized hard drives to create what’s known as a mirrored RAID. When you have such a setup, all data is written to both drives simultaneously, so you always have two copies of every piece of data. I don’t have the space to go into detail about RAIDs, but you can use Disk Utility to create them.

  • If you have some sort of removable or portable media, such as an external hard drive, CD-R or CD-RW, DVD-R, magneto-optical disk, tape drive, etc., you can use it for backing up data. The advantage here is that not only is your data stored on a different storage device than your internal hard drive but the backup is also removable/portable, so it can be stored separately from your computer. If your backups are kept at a completely different location than your computer, your data is still safe in case of theft or disaster.

Businesses that rely on data often take these measures to the extreme. For example, many businesses use a system of on-site/off-site rotating backups. They continually back up data throughout the day, and at the end of each day they give their daily backup media to a data storage service that stores it in disaster-proof, secure data vaults. At the same time, the service returns a previous day’s media to the company for use in the next round of backups. This setup ensures that the current day’s data is immediately accessible, but data from previous days, weeks, or even years is stored at a remote, secure location. This may sound extreme to the average home user, but if data is the heart of your business, such measures are standard practice.

Kinds of Backup Media

In addition to thinking about what to back up, and how often to do so, you should also consider what kind of media to use. There are a few things to think about when considering backup media: reliability, cost, performance, capacity, reusability, and portability. Here are some of the most common types of media and how they fare on these criteria:

CD-R Extremely reliable, provided you use reliable blank media (some of the bargain brands are reported to degrade over time). Blank CDs are extremely cheap (100 for around $30 for name- brand media) and hold 650–700MB each. Data must be written using a CD-R drive but can be retrieved using any CD-ROM drive. Unfortunately, discs can’t be reused and are easily damaged.

CD-RW Similar to CD-R discs, but can be erased and reused (but for a price—CD-RW discs are significantly more expensive than CD-R media). They require a CD-RW drive to write data, but data can be read by most CD-ROM drives.

DVD-R Similar to CD-R discs, but with a much larger capacity (more than 4GB per disc) and higher cost ($3–$10 per disc). They require a DVD-R drive to write data, but data can by read by most DVD-ROM drives.

Zip disk Although Zip disks are very popular, I don’t recommend using them for backup purposes. As a floppy disk-based medium, they aren’t reliable enough, in my experience, to be used for data backup.

Magneto-optical disk Considered to be the most reliable backup media on the market and a good compromise between the reliability of optical media and the speed of magnetic (hard drive) media. Disks are small, reusable, and almost indestructible. Unfortunately, they’re the most expensive media in terms of cost/capacity.

Magnetic tape The mainstay of large-capacity commercial backups because of the combination of reliability, small physical size, and cost per GB (less than $10 for 40GB of storage when purchased in bulk). Tapes can be reused many times. The downside to tape is that restoring files is very slow, and most tape drives don’t allow random access (i.e., you can’t mount a tape and copy files; you have to use a backup utility to restore files). They’re also subject to data loss from strong magnetic fields.

Hard drive Overall, less reliable than other media, but considering that you’re storing a copy of data, rather than the only copy, generally reliable enough. They’re second only to tape in terms of capacity for the price. Drives of 120GB can be had for less than $100, and $300 can get you more than 300GB. Backing up and retrieving data is very fast. They can be erased and reused easily. They’re larger than other media but in a portable enclosure they’re still “tote-able.” Like tape, they’re subject to data loss from strong magnetic fields.

Online/network In addition to local, physical media, it’s also possible to use an online or networked backup service. For example, Apple’s .Mac service allows you to use its Backup application to back up files to your personal iDisk over the Internet. Another popular Mac-focused online backup service is BackJack (http://www.backjack.com/). The clear advantage to an online backup is that it is located off-site. The disadvantages are than you must be connected to the Internet to back up or restore; copying files is usually slower than with local media; and the amount of data you can back up is often limited. (.Mac’s iDisks store only 100MB of data unless you pay to upgrade your storage capacity.)

Backup Strategies

Unfortunately, the subject of backup strategies is a complex one that requires far more space than I have here; entire books have been written on the topic. If you’re interested in more information on specific backup strategies, I recommend Adam Engst’s series of articles for the TidBITS electronic newsletter at http://db.tidbits.com/getbits.acgi?tbser=1041. In addition, Apple’s Knowledge Base contains an article that discusses a number of strategies for backing up, as well as a useful section that outlines the steps to take if you ever need to restore user folders; you can read that article at http://docs.info.apple.com/article.html?artnum=106941.

In case you’re curious about my personal backup strategy, keep in mind that as a writer, all my work is on my computer, and losing a week’s worth of data could be disastrous. For example, it could mean losing an entire chapter of a book! So I practice “backup overkill”—I can’t afford to lose even a day’s work. Here are the parts of my backup strategy:

  • I have a second internal hard drive that I use to mirror my boot volume. Every morning at 3 A.M., a shell script (created using Carbon Copy Cloner, which I’ll talk about in the next section) runs that compares the contents of the backup drive with the boot volume; any new or modified files are copied to the backup drive, and any files deleted from the boot volume are also deleted from the backup. This means that the backup drive will always contain an exact copy of my entire boot volume as of 3 A.M. If my boot volume has problems, I can quickly erase it and restore it from the backup (or, if I just need a copy of one or more files, I can simply copy them from the backup drive). If my boot volume fails completely, I can simply select the backup drive as my startup disk and keep working. The only thing I lose is any work I’ve done between the time of the problem and 3 A.M. earlier that day. (Which, I hope, is taken care of using the next item.)

  • I also have a small, external FireWire hard drive that’s used for periodic backups throughout the day. I use Retrospect (a backup utility mentioned in the next section) to automatically back up my Documents and Desktop folders at 10 A.M., 1 P.M., 5 P.M., and 9 P.M., every day. If anything happens to my computer, I lose a few hours of work, at most. This portable backup drive also comes with me whenever I leave home for more than the day.

  • I have a magneto-optical (MO) drive that I use for “permanent” off-site backups. Every couple weeks I back up my Documents folder to MO disks and then take those disks to a relative’s house for storage. (I sometimes also use CDs to burn copies of photos, older documents, and other files that I want to keep safe, and store those discs off-site.)

This strategy is both convenient and secure, as it lets me immediately get up and running in the event of a serious hard drive problem, but it also keeps a regular backup of the most important files, stored off-site in case of a major disaster. It sounds like overkill, but keep in mind that for this book I tested literally hundreds of pieces of software—many of which altered the OS, and some of which were beta versions—so I was asking for trouble on a daily basis. On more than one occasion my Mac had serious problems because of my experimentation, yet I was never down for more than a few hours.

Backup Utilities

There are more backup-oriented utilities for OS X than you can shake a stick at—a search for backup on VersionTracker.com produces almost 80 results! You can even use Terminal—manually, or via a utility such as Carbon Copy Cloner, mentioned below—to copy or synchronize files from one volume to another.

I’d love to walk you through some of my favorite backup and synchronization utilities—really, I would; there are so many cool backup utilities out there now that there’s no excuse not to back up— but I’m running out of space in this chapter. Instead, I’m going to mention a few of the best; most have great documentation that, along with the general backup concepts I’ve covered, should get you up and running quickly. Most also offer additional features such as scheduled backups (updating your backup with new and modified files according to a schedule), cloning (making an exact copy of a folder or volume that’s usable in the Finder), and synchronization (a two-way procedure used to keep two fold- ers or volumes up-to-date so that they each contain the newest version of every file).

Note

Most backup utilities require administrator access since they need to back up files regardless of the owner and since they usually require a system-level startup item or access to the system’s crontab to schedule automated backups.

In terms of traditional “backup” software—utilities that are intended to help you archive files for safekeeping and restore them, if needed, at a later date—Dantz’s Retrospect (http://www.dantz.com/en/products/, commercial) has long been the king, and for good reason. It’s got more features and functionality than anything else on the market, making it the most powerful and flexible option available. Home users should consider the Desktop version, which offers more than enough features for most people (including the ability to automatically back up two computers over a network, perfect for backing up your laptop).

Although Retrospect is highly respected as a backup tool, the main criticism of it is usually that it has a steep learning curve. Because it has so many features and options, it can be a bit intimidating; in addition, the average user really doesn’t need many of its more advanced features. As a result, a lot of alternatives to Retrospect have sprung up. Two of the best are Prosoft’s Data Backup X (http://www.prosoftengineering.com/products/, commercial) and the shareware Déjà Vu (http://propagandaprod.com/). Data Backup X actually has many (though not all) of the same features as Retrospect, but its interface is more accessible for the average user. For example, you can set up, customize, schedule, and run your backup all from a single window (Figure 14.8). If you want to create a scheduled action, the various options are explained clearly so that you know exactly what your newly created schedule will do, and when. Data Backup X gives Retrospect a run for its money as one of the best full-featured backup utilities for home users.

Figure 14.8: Data Backup X’s main window lets you easily configure and run backup actions

Déjà Vu is much more limited than Retrospect or Data Backup X, but it’s also incredibly easy to set up. It runs as a preference pane and provides a simple list of folders to be backed up (Figure 14.9). You click the + button to add a new schedule, select how often you want it to be executed (daily, weekly, or monthly), and then choose the folder to be backed up and the destination for the backup. The Options screen lets you specify the times and days/dates the backup should occur, and you can also choose to mirror the folder instead of archive it (mirroring means that if you delete a file or folder from the original folder, it will also be deleted from the backup). Finally, Déjà Vu provides a convenient display of when the most recent daily, weekly, and monthly backups were executed, so you know exactly when your files were last backed up.

Figure 14.9: Déjà Vu’s backup scheduler is simple to set up.
Tip

If your main goal is to synchronize two folders or volumes so that they each contain the newest version of every file— for example, to keep your Documents folder on your laptop and your desktop Mac in sync—you may want to consider a dedicated synchronization utility. You Synchronize (http://www.yousoftware.com/, formerly ExecutiveSync), ChronoSync (http://econtechnologies.com/), and Synchronize! Pro X (http://www.qdea.com/) are a few of the best.

Finally, I mentioned that one of my “get back up and running fast” strategies is to keep an exact copy of my boot volume on a second hard drive, updated nightly. For this I use the excellent Carbon Copy Cloner (http://www.bombich.com/software/ccc.html). In Chapter 4 I showed you how to use Carbon Copy Cloner to "clone" a volume; it also offers the ability to mirror a drive and update that mirror on a regular schedule. In fact, it actually does this by creating a shell script and then using a system-level crontab entry to run it! See the Carbon Copy Cloner documentation for more details on using it in this way.

Note

If you’re a member of Apple’s .Mac service, you can download a copy of Apple’s own Backup utility. Early versions of Backup were extremely limited, but the most recent versions are actually quite capable for backing up documents and important files, if not entire volumes. If you aren’t a .Mac member, see http://www.drijf.net/dototto/ for some tips on using Backup without a membership.

I’ve only listed a few good utilities here. As I mentioned earlier, many, many good backup utilities are available for Mac OS X; you may prefer one of the other options. The important thing is that you use one.


Moving On...

Team LiB

Moving On…

Now that you’ve learned more about what it takes to keep your Mac running smoothly, it’s time to move on to the ultimate “power user” topic: Unix. I’ve talked about OS X’s Unix background many times over the past 14 chapters, and I’ve even had you work with it a number of times. But in the next chapter I’ll talk about the Unix underneath OS X in depth, cover some more complex Unix exercises, and even show you how to take advantage of those Unix roots to install and use additional software titles.


Chapter 15: Utilizing Unix

(Or: Unix isn’t a four-letter word.)

Overview

Although Mac OS X is built on Unix, Apple has done an amazing job of shielding users from the command line; in fact, it’s possible to completely ignore the Unix layers running “under the hood,” if desired. Nevertheless, every time OS X boots up, it starts out as a command-line system, loading the familiar Aqua interface only after the Unix-based Darwin environment—which is always in the background, managing hardware and software—is ready. This means the command line is the ultimate power tool in OS X. It provides a “back door” to many advanced and hidden capabilities built into the operating system.

In addition, OS X’s Unix compatibility means that you have the ability to use a host of powerful (and often free) Unix programs. The best known is probably the Apache Web server (accessed most simply via Personal Web Sharing in Sharing preferences), but OS X also runs hundreds of other Unix-based programs such as the vi and emacs text editors, the ipfw firewall, and the perl programming language. (These are all built into the standard OS X installation; adding other programs can be surprisingly easy, as I’ll show you in this chapter.) Although OS X’s Unix subsystem can be a bit intimidating to new users, Darwin brings a wealth of new capabilities to OS X. I’ll spend this chapter talking about many of these features and showing you ways to take advantage of them.

Note

The version of Chapter 15 in the first edition of Mac OS X Power Tools contained a lot of great information from Chris Pepper. The version you’re reading in this edition has been substantially revised with a huge chunk of help from James Bucanek. (Read: he should get all the credit, and I any criticism.)


Unix Doing in Mac OS X?

To leapfrog past limitations in the Classic Mac OS (particularly in the areas of stability, memory management, and multitasking), Apple went back to the drawing board for Mac OS X. The result was a hybrid operating system based on NeXTStep—a Unix-based OS developed by NeXT Computer, Steve Jobs’s post-Apple company—but with an interface closer to Mac OS 9. The bulk (and benefits) of each system have been carried forward into Mac OS X: the BSD Unix/Mach layer of NeXTStep is now called Darwin and manages booting, memory management, multitasking, and drivers; a few of the best aspects of the NeXTStep interface have been combined with Apple’s Classic Mac OS appearance to create the Aqua interface; and the advanced programming environment developed at NeXT has become what is now known as Cocoa. (You’ll remember Cocoa from Chapter 7 when I talked about Cocoa applications.)

As a result of its hybrid nature, OS X is extremely mature and stable in some areas, but less polished in others. Apple has changed Application Programming Interfaces (APIs) with each revision and continues to flesh out certain aspects of the system. In many cases, Apple has included useful features of NeXTStep, FreeBSD, and NetBSD without providing easy access to this functionality.

The good news, as you’ve seen in numerous examples throughout this book, is that the Terminal utility provides access to a great deal of this untapped power. In addition, many developers have created third-party tools that allow you to access features Apple hasn’t (yet) exposed, without having to delve into Terminal. NFS Manager (mentioned in Chapters 10 and 11), which allows you to use the NFS client and server built into OS X, and BrickHouse (discussed in Chapter 12), which provides an interface for the built-in ipfw firewall, are good examples. Apple itself continues to expose more hidden functionality with each release, and Mac OS X Server distinguishes itself largely by providing better GUI configuration tools for programs included in OS X. However, because most of the actual features of OS X Server exist in the standard version of OS X, power users with sufficient knowledge are able to take advantage of Mac OS X Server’s functionality using the much less expensive, non- Server version of OS X. What’s more, knowledge of the appropriate command-line programs and third-party utilities can often provide access to "next year’s" features before Apple makes them officially available.

Note

For more information about Mac OS X’s underlying architecture and Apple’s open-source Darwin project, point your browser to http://developer.apple.com/darwin/projects/darwin/ and http://developer.apple.com/macosx/architecture/. You can learn more about OS X’s Unix roots at http://developer.apple.com/documentation/Darwin/Darwin.html.

Types of Unix Programs

The programs you’re likely to encounter in Unix can be broadly classified into one of three categories. The first are simple, command-line programs that do very basic tasks. You type the command in Terminal and can immediately move on to another command. The second group, interactive programs, are also accessed via Terminal, but take over the current Terminal window (shell) until they’re done running. In some ways, interactive programs work much like regular Macintosh applications—you use them (inside the current Terminal window) until you’re done, at which point you issue some sort of “quit” or “exit” command to stop them. Some of these programs (such as ftp) have their own command structure that you access from the command line, whereas others (such as the pico text editor) take over the entire screen.

Finally, the third group is composed of background applications, commonly known as daemons. These programs run “invisibly,” with no user interaction whatsoever. There are dozens of these daemons in Mac OS X; two of the most notable are the Apache Web server, which provides Personal Web Sharing, and AppleFileServer, which provides Personal File Sharing. Deamons are typically customized by editing their configuration files. You’ve already worked with such configuration files, such as the httpd.conf file used by Personal Web Sharing, in other parts of this book.

Start Sidebar
The Terminal Utility: Your Door to the Unix World

Terminal, located in /Applications/Utilities, provides an interface for, and access to, Mac OS X’s command-line interface. I’ve already talked about Terminal many times in the book, and you’ve probably used it several times as you followed along with the examples I’ve provided. However, I want to spend a few paragraphs here talking about the Terminal application itself. (Some of the information in this sidebar may not make complete sense until you’ve read more of this chapter; feel free to read ahead and then come back later.)

At the most basic level, Terminal is a terminal emulation program; that is, it pretends to be an old Teletype terminal like the ones you see chattering away in old movies and news programs from the 70s. Each window in Terminal is essentially a “dumb terminal.”

Terminal Windows and Display

Launching Terminal (or, if it’s already running, choosing File Ø New Shell) opens a new Terminal window and starts a Unix program called a shell, which is the actual text interface that allows you to type Unix commands. (I cover the use of the shell—entering commands and reading outputs—in the main text of this chapter.)

You can actually open multiple Terminal windows open simultaneously—as many as you need. Each window has its own set of properties that determines how it behaves. These properties include the size of the window, the colors and cursor used in the window, as well as which “dumb terminal” capabilities the window will emulate. You can control these properties via the Terminal Inspector palette (which can be viewed by choosing Terminal Ø Window Settings…). One of my favorite Terminal window preferences is transparency, accessible by choosing Color from the Terminal Inspector window’s pop-up menu. By increasing the transparency, you can view windows and files hidden behind the Terminal window. This can be extremely helpful when you’re trying to view the spelling of a file or directory, or when you’re trying to follow a tutorial from a website.

If you work with non-English text and filenames, you’ll eventually notice that terminal emulation programs generally display only 7-bit ASCII characters. To make your Terminal windows a bit more international, first switch to the Emulation panel in the Terminal Inspector palette and check the “Escape non- ASCII characters” option. Then switch to the Keyboard panel, and make sure the “Use option key as meta key” option is disabled. Finally, switch to the Display panel, and choose Unicode (UTF-8) from the Character Set Encoding pop-up menu. (You will also want to familiarize yourself with the -w (raw text) option in the ls command.) See "Saving Custom Window Settings and Commands," later in this sidebar, to learn how to make these changes permanent.

The Scrollback Buffer

Although Terminal emulates a Teletype machine, it obviously doesn’t provide you with a physical printout of all input and output (the “paper tape”). However, it gives you something even better: a scrollback buffer that keeps a record of text as it scrolls off the screen. You can browse the text in the scrollback buffer by using the current window’s scroll bar, by using the page up/down keys, by using the home/end keys, by pressing command+up/down arrow, or by choosing commands from the Scrollback menu. (How much text the buffer remembers is controlled by the Buffer panel of the Terminal Inspector palette.) You can even save the contents of the buffer to a text file by choosing File Ø Save Text As…

Editing Text in Terminal

When you use the Cut and Copy commands in a Terminal window, you’ll find they don’t work exactly the same way they do in other applications. Although you can select any portion of text in a window and then copy it to the clipboard, you can’t Cut or Clear that text because the Terminal window isn’t a document; it’s simply a history of the text output by the Unix programs you’ve used.

Pasting text from the clipboard is equivalent to typing that text into Terminal using the keyboard. However, just as you can’t cut or clear text, you can’t replace selected text by pasting it into Terminal; the text will be pasted at the current command prompt (the flashing cursor at the end of the buffer).

Terminal also supports text clippings; however, just as you can only paste text at the command prompt, dragging a text clipping into a Terminal window will paste it at the prompt, regardless of where in the window you “drop” it. (You can use this to your advantage if you want to type some text that’s already displayed in a Terminal window: simply select the text, drag it a little bit, and then drop it; it will be pasted at the prompt.)

Terminal Shortcuts

For Unix programs/commands that don’t require that you run them from within a shell, you can use File Ø New Command… to open a window running a particular application. Choosing File Ø Connect to Server… instead opens a window running SSH, SFTP, FTP, or telnet, so you can easily log in to a remote computer.

Splitting the Difference: Split Windows in Terminal

If you find yourself scrolling up and down in Terminal because you want to see something a few pages back in the buffer, while at the same time trying to type in a command, you’ll love Terminal’s split-screen mode. In the upper-right corner of any open Terminal window, just above the vertical scroll column, you’ll see an icon that looks like a square that’s been torn in two (circled in the upper-right corner of the top graphic below). Click it and the window will split in two. The bottom section will always show the command prompt, whereas you can scroll through the buffer in the top section (as shown in the bottom graphic below). You can click the divider and drag it up or down to change the relative sizes of the two sections. Clicking the same “button” in the scrollbar again restores the window to a single pane.

Click To expand

Saving Custom Window Settings and Commands

As I mentioned above, you can use the Window Settings… dialog (also known as the Terminal Inspector) to set your preferred window settings for the frontmost window, including colors, dimensions, display font and styles, buffer size, and window processes. However, at the bottom of the window is a “Use Settings as Defaults” button that you can click to set the current preferences as the defaults for all new windows.

On the other hand, if you tend to use different groups of settings, you can save each group individually. To do this, open a window, resize it to your preferred size, select your settings from the Terminal Inspector, and then close the Terminal Inspector. Then choose File Ø Save As…, choose Main Window from the “What to save” pop-up menu, and save the Terminal window in a convenient location. (It will automatically be saved with a .term file extension.) You can even choose to have your saved Terminal window open automatically when Terminal starts up by checking the "Open this file when Terminal starts up" box in the Save dialog.

When you want to use these saved window settings, double-click the saved Terminal window file, or choose File Ø Open… from within Terminal and select the saved Terminal window file. You can use this procedure to save as many different groups of Terminal window settings as you like.

Note that if you want this saved Terminal window file to automatically execute a specific command when opened, you can edit the file itself using a text editor such as TextEdit or BBEdit. Scroll to the end of the file, and insert the following text before the final </dict>:

<key>ExecutionString</key>
<string>command</string>

where command is the Terminal command you want to execute when the file is opened. For example, you could type sudo -s to give yourself root access whenever this Terminal window is opened (you’d still need to provide your admin password) or ssh username@serveraddress to automatically connect to a remote server via SSH.

To make it easier to access multiple .term files, create a new folder called Terminal inside ~/Library/Application Support, and then save your .term files there. This will make them accessible from Terminal’s File menu (File Ø Library Ø filename).

Alternatives to Terminal

It’s important to realize that Terminal is not Unix’s command-line interface. It’s simply a way to access that interface. The actual interface is the shell application that is run when a new Terminal window is opened. Although Apple has included the Terminal utility for the purpose of interacting with the shell, you can actually use any of a number of different applications that provide the same functionality For example, I personally use iTerm (http://iterm.sourceforge.net/) instead of Terminal. iTerm provides a number of helpful features not available in Terminal; my two favorites are bookmarks, which let you quickly access specific servers and/or commands, and the ability to open multiple shell sessions in a single window. (You switch between them via tabs, much like the tabbed Web browsing I talked about in Chapter 9.)

End Sidebar

In this chapter, I mainly explore the world of the first category: command-line programs. I’ll show you where to find commands, how to execute them, and how to string them together to create powerful solutions.

Note

In many places in this chapter I’ll use words like almost, generally, typically, and probably. This is because it’s often hard to make definitive statements about Unix—there are always exceptions. For example, daemons are typically customized by editing configuration files, but some aren’t—some are controlled by a database, and others require you to send commands to them over a network. Some even have to be recompiled to alter their behavior. So take absolute statements with a grain of salt; there’s probably an exception. (Don’t be surprised if you find it!)

The Mac Approach vs. the Unix Approach

The Macintosh’s graphical user interface and Unix’s shells—the Unix applications through which you access the command line—are clearly on opposite ends of the interface spectrum. Apple has worked very hard to bring the power of computers to the average user. Unix hasn’t. That’s not to say that Apple is smart and Unix developers are dumb, but rather that they’re approaching computing from opposite directions. Apple’s goal is to put as much power as is reasonably possible within the grasp of non-technical users. The Unix approach is to give the full power of computing to those who can grasp it. Apple tries to anticipate what you want to do with your computer and provide easy means to do it. Unix makes very few assumptions about what you want to do and simply provides a wealth of tools for you to build your own solutions.

To put this into kid terms, Apple gives you Barbie’s Dream House, and the Unix shell gives you a huge LEGO set. When you buy Barbie’s Dream House, you get a beautiful toy created by master toy makers. It has intricate detail, designer interiors, and easy-to-use functionality. All of the pieces fit perfectly. For playing house, you won’t find much better. When you buy a LEGO set, you get a bunch of pieces. If you want to play house, you’re going to have to design the house, create the floor plan, build the walls, anticipate where the windows are going to go, and so on. And even when you’re done, it’s not going to be as pretty as Barbie’s.

This, essentially, is the difference between Apple’s user interface and the Unix shell. Apple’s Finder lets you move, copy, and rename files by clicking and dragging colorful icons. The Unix shell lets you move, copy, and rename files by typing commands and filenames. Most of the time, it’s easier to use the Finder (Figure 15.1).

Figure 15.1: Moving a file to the Desktop using the Finder (top) and Terminal (bottom)
Start Sidebar
The Power of the Shell (i.e., Why Use Terminal?): An Example

You may be wondering why any sensible person would want to use Terminal to do something that can be done using the friendly confines of the Finder (or a GUI application). If you’ve never used Unix before, that’s a perfectly reasonable question; however, there are many situations where Terminal might be preferable to graphical-interface solutions. In this sidebar, I’ll present a “real world” example of a situation where Terminal and Unix’s command-line applications may actually be faster, and possibly even easier, than using the Finder—assuming you have the ability to take advantage of them.

The Task

Consider the following hypothetical situation: You’re helping a hiking club set up a website that chronicles their hikes in the Grand Canyon. You’ve been collecting full-sized pictures of each trek in a set of folders, and you’ve now got more than 2,000 images. The Webmaster has just called and told you that she’s designed a new feature for the website where users can search or browse the site and see a table of thumbnail images from which to choose. She needs you to create a thumbnail-sized copy of every image. Each thumbnail should be no bigger than 140 ´ 140 pixels. She also wants you to combine all 2,000 thumbnail images into a single directory. She’d like all of this by tomorrow morning so she can start testing.

The Obstacles

Because the pictures were taken with different cameras, many of them have the same name (img_0001.jpg, img_0002.jpg, etc.), so you’ll need give them all unique names and generate a list documenting which image file corresponds to which thumbnail file. Furthermore, all of the thumbnail file names need to be appended with either a v (for vertical) if the image is taller than it is wide or an h (for horizontal) if it’s wider than it is tall.

You could use iPhoto to collect all of the images into a single album. You could then manually separate the vertical images from the horizontal images, resize them all, and then export them in groups. But iPhoto won’t document the correlation between the original images and the ones it just exported; you’d have to visually compare 2,000 images to match them up. If you export them with their original names, you’d have to manually rename 2,000 files while noting what the changes were. Even if you’re an amazing typist who could rename and note each filename change in a mere 15 seconds, it would take you more than 9 hours of frantic typing just to rename the files. Ultimately, you’re looking at 10 or more hours of tedious labor. Not to mention the fact that when someone submits a new set of pictures you’d have to start all over.

At this point, you might be thinking, “There must be a better way!”

The Solution: Unix Tools

Using Terminal and some basic Unix programs, there is a better way. In this chapter, I’ll explain a number of Unix shell concepts and exercises. As I do, keep this hypothetical situation in mind. By the end of the chapter you’ll see how such a task can be accomplished quite easily, and quickly, by avoiding the graphical interface altogether and taking advantage of OS X’s Unix underbelly.

End Sidebar

Another important difference between the Mac OS approach and the Unix approach is that Unix generally assumes that you know what you’re doing. I don’t mean this in a “take off the training wheels” sort of way, but rather in a “here’s the nuclear football; be careful what you do with it” way. You can easily issue a single Unix command that irretrievably erases the contents of your entire hard disk. There will be no dire warning about the consequences; Unix will simply get to work destroying every bit of data you have. So unlike the Mac OS, where you can generally fool around without doing too much damage, when working from the command line, you clearly want to learn a little about what you’re doing before you do it—and make sure you have backups.


Shell Games: Using the Shell

Human beings control most Unix tools through a shell—a program that lets you interact directly with the heart of a Unix operating system (which includes Mac OS X, as it’s based on Unix). Although they’re subtly complex, shells don’t really do much on their own. Like roads and buildings, shells provide the infrastructure so that other programs can get to work. When you open a Terminal window, or log in to a computer via ssh (as explained in Chapter 11), you’re interacting with a shell. In Mac OS X, the most commonly used shells are bash and tcsh. (See the sidebar "Panther vs. Jaguar: Default Shells" for more information.)

Start Sidebar
Panther vs. Jaguar: Default Shells (i.e., bash vs. tcsh)

In Mac OS X 10.2 and earlier, the default shell—the one used when you open a new Terminal window—is tcsh, a descendent of the csh shell. In OS X 10.3, Apple changed the default shell to bash, a descendent of the sh shell. (If you upgraded to OS X 10.3 from an earlier version of OS X, and are using an account created under OS X 10.2 or earlier, then you’re still using tcsh. If your account was created in 10.3, your shell is bash.)

Unix aficionados are fond of long, technical, and tedious arguments, and there are few arguments longer or more tedious than which is better, tcsh or bash. Although both shells have their strengths and weaknesses, it’s generally agreed that tcsh is easier to use interactively, whereas bash is better at scripting. This is why Apple originally chose tcsh as the default shell. However, the Linux crowd likes bash, so Apple’s switch to bash was probably made to make transitioning from Linux to Mac OS X easier. If you’ve already learned tcsh, then stick with it. If you’re just learning the shell, I suggest using bash because it appears to be the future for OS X.

Although making bash the default shell is new in Mac OS X 10.3, the bash shell itself isn’t. All versions of OS X contain both bash and tcsh, and you can make either your default shell in any version. If all of your interaction with Unix will be done via Terminal, then you can simply change the shell that Terminal starts when you open a new Terminal window. To do this, open the Terminal preferences dialog and type /bin/ tcsh or /bin/bash—whichever is appropriate—under "Execute this command (specify complete path)."

If you’d like to temporarily use a different shell, remember that shells are just interactive Unix programs. In the current shell, type bash or tcsh, and a new shell will start using the respective shell. You’ll continue to use that shell until you issue the exit command (or close the Terminal window).

If you’d like to make bash (or tcsh) the default shell everywhere (Terminal, when logging in remotely via ssh, etc.), then you need to change a property in the NetInfo database.

  1. Open the NetInfo Manager application. (Authenticate, if necessary, by clicking the padlock icon and providing your admin username and password.)

  2. Select the users item in the middle column, and then select your short username in the column to the right.

  3. In the Property/Value(s) pane, scroll down until you see the shell property.

  4. Double-click the value for the shell property to edit it. To use tcsh as your default shell, type /bin/ tcsh ; if you want bash, type /bin/bash.

  5. Choose Domain [head2right] Save Changes.

For simple commands, there’s little difference between bash and tcsh. When the differences are significant, I’ll point them out or give examples for both shells.

End Sidebar

Regardless of which shell you’re using, there are editing commands and keyboard shortcuts you can use to make working in the shell easier. Here are a few:

left/right arrow | Moves the cursor left/right within the line being entered.
control+A | Moves the cursor to the beginning of the line.
control+E | Moves the cursor to the end of the line.
delete | Deletes the character to the left of the cursor.
control+W | In bash, deletes one word to the left of the cursor. In tcsh, deletes everything to the left of the cursor.
tab | Auto-completes the current command or filename, if possible.
up/down arrow | Scrolls backward/forward through the history of commands you’ve entered in the current shell session. It’s often quicker to scroll up and reissue a command, making slight modifications first, than to type the whole thing over again.

Shell Commands, Options, and Arguments

The shell exists to execute commands for you. Almost all commands are small Unix programs located on your hard drive. You can see a list of the basic ones, located in the /bin directory, by opening a Terminal window and typing ls -l /bin <RETURN>.

The command you just used is actually a good example of a basic shell command, which generally consists of a command program (the first word of the line) followed by arguments, separated by spaces, that tell the program exactly what to do. It can also include options that affect exactly how the program works; these options are interpreted by the command program itself and are generally preceded by a hyphen (-) to distinguish them from arguments. In other words, a typical shell command looks like this:

command -option(s) argument(s)

When you press the return key, the shell interprets the command line, passes it to the specified program, and then displays the program’s output, if there is any.

Note

Options and arguments aren’t always required. Some programs work without one, the other, or both. Others will return an error if one or both are missing.

In terms of the command you just used, the shell ran the ls (list directory contents) program. The -l option told ls to produce a "long" listing, rather than the short (terse in common Unix-speak) one it normally produces. The /bin argument told ls which directory to list. (If you scroll through the output of that command in Terminal, you’ll see that the ls command is actually one of the programs in the /bin directory.) Table 15.1 contains some basic shell commands.

Table 15.1: Some Basic Shell Commands
Command | Function | Useful Options | Other Arguments
ls | List files | -l: Use long listing format -F: Show file-type suffixes | Which files to list, or which directories’ contents to list (defaults to current directory)
pwd | Print working directory |  |
cd | Change directory |  | Which directory to change to (defaults to user’s home directory)
mv | Move files (also used for renaming files) |  | Which files to move, where to move them, what to name them
cp | Copy files | -R: Recursively copy the contents of directories | Which files to copy, where to copy them, what to name the copies
rm | Remove files | -i: Confirm each file before deleting -r: Recursively delete the contents of directories | Which files to remove
echo | Echo arguments (output them to stdout—described later in this chapter) | -n: Don’t output a return character at the end | Strings to be echoed
open | Open in Finder | -a: Specify application for opening file | Which file/folder/application to open

Quoting Special Characters

In describing arguments, I noted that arguments are “separated by spaces.” This is a subtle, but very important, note, because it means that if the shell sees a space when reading arguments, it will assume that the space is separating two different arguments. Thus, if you type a path, filename, or folder name that contains a space, the shell will read that argument as two separate arguments. So how can a file or directory name that contains a space be used as a single argument?

The solution is to “escape” or “quote” the space character so that the shell treats it as part of the current argument rather than as a separator between arguments. In fact, you use this “escape” technique whenever you need to use a character (in an argument) that’s considered by the shell to have special meaning. The space character is just one of these special characters.

There are four quoting/escape characters: ' (single quote), " (double quote), \ (back slash), and another one I’ll get to later. Both of the quote characters are used in pairs, one before the text and one after, to treat everything in between as a single argument. (The difference between a single-quoted and a double-quoted argument is that the shell may treat some special characters within double quotes as special, and interpret them, whereas the shell completely ignores the special significance of any characters within single quotes.) Using the back slash simply "escapes" the very next character; in other words, it tells the shell to treat the character that immediately follows the back slash as a text character and to include it as part of the current argument. The back slash and quote characters are never part of the argument that the shell passes to the program.

Here’s an example of the use of the back slash to escape a space:

local:~ frakes$ cd ~/Pictures/Grand\ Canyon/Hikes
local:~/Pictures/Grand Canyon/Hikes frakes$

The cd command was invoked with the single argument ~/Pictures/Grand Canyon/Hikes because I "escaped" the space, which told the shell to treat it as a regular character. Here’s another example using double quotes:

local:~ frakes$ cd "~/Pictures/Grand Canyon/Hikes"
local:~/Pictures/Grand Canyon/Hikes frakes$

The double quotes told the shell to treat everything within the quotes as part of the argument. Finally, here’s an example using single quotes:

local:~ frakes$ cd '~/Pictures/Grand Canyon/Hikes'
bash: cd: ~/Pictures/Grand Canyon/Hikes: No such file or directory

What went wrong? Remember that I said single quotes prevent the shell from interpreting special characters? Well, ~ is one such character. As you can see from the following (correct) example, quoting can require some care:

local:~ frakes$ cd ~/Pictures/'Grand Canyon'/Hikes
local:~/Pictures/Grand Canyon/Hikes frakes$
Tip

If quoting/escaping seems like a pain, Terminal has a couple very useful features to help you out. First, if you’re trying to type a path to a file or folder, you can drag the icon of the file or folder from the Finder into a Terminal window; Terminal will automatically insert its complete, and correctly escaped, path. Second, if you’re trying to type something that you can copy to the clipboard from another application, copy it and then switch to Terminal and choose Edit Ø Paste Escaped Text; this will paste text from the clipboard into the Terminal window, escaping all special characters.

Auto-Completion

Another very handy feature of the shell is command auto-completion. If you’re typing a command or filename, you can ask the shell to “auto-complete” it by pressing the tab key. This feature is one of those that’s easier to understand once you see it in action, so open Terminal and follow along.

At the shell prompt, type cd /V<TAB>. The shell should have automatically "typed" /Volumes/— cool, eh? The shell looked at the last item you were typing (/V, in this case) and decided that it appeared to be the start of a file path. The shell then searched for all of the possible paths that begin with /V and could only find one, the /Volumes directory. So it filled in the rest for you. You can continue adding on to the path, pressing <TAB> each time you’ve typed just enough for the shell to know which file or directory you mean.

What if you don’t type enough? Try this: cd ~/D<TAB>. The shell beeps at you because it can’t decide between ~/Documents and ~/Desktop (and any other D folders you might have inside your home directory). Give it enough to make a decision by adding e<TAB>, and it will auto-complete ~/Desktop. Alternatively, when you get the "not enough information beep," press the tab key again (control+D in tcsh) to get a list of the possibilities.

Tip

Auto-completion also correctly quotes/escapes filenames and paths for you. You’ll even find that auto-completion works in other places, such as the Go To Folder dialogs in the Finder and Open/Save dialogs (discussed in Chapter 5).

Globbing

In the Finder, if you want to work with more than one file at a time, you first select the files and then you perform some action on them (such as File Ø Move to Trash). In the shell, you type the name of the command being used, followed by a list of files with which you want it to work. That’s not too much of a problem for two or three filenames, but what if there are dozens? Or hundreds? The solution is called globbing in Unix-speak, and it involves a few of those other “special characters” I mentioned earlier.

The globbing characters (perhaps more commonly known as wildcard characters) are * (asterisk), which matches any character or sequence of characters, including no character; ? (question mark), which matches any single character; and [ and ] (square brackets), which are used to match a particular set of characters. When a wildcard is used in an argument, the shell first searches the designated directory for all names that fit the pattern of that argument. A name will match the pattern if the name contains all of the same non-wildcard characters and if the remaining characters in the name can be acceptably paired with each wildcard. If one or more names in the directory match the pattern, the original argument—containing the wildcard(s)—is replaced with the explicit name(s) of each matching directory item, and then the actual command is run.

OK, that was probably pretty confusing. Here’s an example of a list of files, various patterns using the * and ? wildcards, and which of those patterns match which files. The underlined characters indicate which characters matched the wildcards.

 | *.doc | *thing.* | something?.jpg | Any?????.doc
Anything.doc | Anything.doc | Any thing.doc |  | Any thing.doc
Anytime.doc | Anytime.doc |  |  |
Anywhere.doc | Anywhere.doc |  |  | Any where.doc
Something.jpg |  | Some thing.jpg |  |
Something2.jpg |  |  | Something 2.jpg |
Something3.jpg |  |  | Something 3.jpg |

The square brackets ([and ]) are a bit more complicated. Like the question mark wildcard, a set of brackets will match only a single character. However, unlike the question mark, which matches any single character, a set of brackets will match only a character that’s enclosed in the brackets. For example, [ABD] would match either A, B, or D. So the argument [ABD]* would find a match in the filenames Able, Baker, and Delta, but not Charlie or Echo.

Tip

You can designate a range of characters to be matched by a pair of square brackets by using a hyphen (-) inside the brackets. For example, the pattern File[0-9].txt would match the filenames File2.txt and File7.txt, but not FileB.txt or File23.txt (the latter because there are two numbers between File and .txt—File23.txt would instead match File[0-9][0-9].txt).

The asterisk (*) is, by far, the most commonly used globbing character. Here’s an example of using the globbing character to get a list of all the files that end in .jpg that reside in a particular directory:

[local:~/Pictures/Grand Canyon/Hikes] frakes% echo Bass\ Esplanade/Apr-2003/*.jpg
Bass Esplanade/Apr-2003/CamPic01.jpg Bass Esplanade/Apr-
2003/CamPic02.jpg Bass Esplanade/Apr-2003/CamPic03.jpg Bass
Esplanade/Apr-2003/CamPic04.jpg Bass Esplanade/Apr-
2003/CamPic05.jpg Bass Esplanade/Apr-2003/CamPic06.jpg Bass
Esplanade/Apr-2003/CamPic07.jpg Bass Esplanade/Apr-
2003/CamPic08.jpg Bass Esplanade/Apr-2003/CamPic09.jpg Bass
Esplanade/Apr-2003/CamPic10.jpg Bass Esplanade/Apr-
2003/CamPic11.jpg Bass Esplanade/Apr-2003/CamPic12.jpg Bass
Esplanade/Apr-2003/CamPic13.jpg Bass Esplanade/Apr-
2003/CamPic14.jpg

The echo command is very useful for seeing how the shell handles arguments. As its name implies, echo simply "echoes" the argument you gave. (Try the command echo 'Hi there!' <RETURN>.) Everything you see output in the above example was generated by the shell when it expanded the single Bass\ Esplanade/Apr-2003/*.jpg argument into 14 separate arguments.

Note

Remember that the shell is case sensitive, so *.jpg and *.JPG will match two completely different set of files.

In addition, globbing matches directory names as easily as it matches filenames. An argument such as ~/Pictures/Grand Canyon/Hikes/*/*.jpg would expand to every .jpg file in all of the subdirectories contained in Hikes.

On the other hand, if you need to identify files in multiple directories that are at different “depths” (that is, files anywhere within a folder regardless of how many subfolders the folder is buried in), globbing is inconvenient. Fortunately, there’s a Unix tool for just such a task: Find.

The find Command

You use the find command to search an entire directory tree for files or directories that match a certain criteria. Its capabilities are similar to the Find command in the Finder; however, as a command- line tool, it uses the command argument syntax. The first argument you provide is the directory to be searched. The remaining arguments are the rules for matching files. The -name argument matches names using the same globbing rules as the shell, so *.jpg matches any file that ends in .jpg. (Note that you must quote the pattern to be matched. If you don’t, the shell itself would try to "glob" the pattern rather than passing it to the find command. Tricky, eh?) Here’s an example:

[local:~] frakes% find Pictures/Grand\ Canyon/Hikes -name '*.jpg'
Pictures/Grand Canyon/Hikes/Bass Esplanade/Apr-2003/CamPic01.jpg
Pictures/Grand Canyon/Hikes/Bass Esplanade/Apr-2003/CamPic02.jpg
Pictures/Grand Canyon/Hikes/Bass Esplanade/Apr-2003/CamPic03.jpg
Pictures/Grand Canyon/Hikes/Bass Esplanade/Apr-2003/CamPic04.jpg
… (and so on)

I told find to start looking in the Pictures/Grand\Canyon/Hikes directory and to find every file that matched the pattern *.jpg. (Note that I could have also used find "Pictures/Grand Canyon/ Hikes" -name '*.jpg' to write the same command—remember what I said about escaping spaces.) You could also include additional rules to create very complex searches. See "Everybody Needs a Little Help Sometimes," later in this chapter, for how to learn more about the arguments you can use with the find command (or any other command, for that matter).

Note

Have you ever wondered why the Finder in Mac OS X is called the Finder, and not the Desktop or the Control Center, or some other name, relating to working with files, that’s more appropriate? In the original version of the Macintosh operating system, the Finder was a simple program written to find and open files—that was it! The original authors of the Finder probably never dreamed of how integral, and inseparable, a part of the Mac OS the Finder would become. Yet through all of the myriad revisions and rewrites of the Mac OS over the past two decades, we still call it the Finder.

Be Aware of Your Environment: Variables

When you work in the shell, you can save bits of frequently used data (or less used data, for that matter) using what are called variables. You can refer to one string of characters using another—usually simpler—string of characters. Taken as a whole, the variables you create comprise your shell environment; your environment holds information about who you are, where you’re working, and what characteristics the shell has while you’re using it.

Setting and Using Variables

You work with variables by setting them (specifying what they stand for, or changing what they stand for if a value already exists) or deleting them (removing them so that the variable no longer exists). In the bash shell, you set a variable using the equal (=) symbol: variablename=value. For example, to make the letter n equal to the number 1, you’d type n=1 <RETURN> in Terminal. (In the tcsh shell, you need to actually use the set command: set variablename=value, as in set n=1 <RETURN>.) To delete a variable in either shell, use the unset command: unset variablename. (For this example, unset n <RETURN>.)

Note

In this section, I’m specifically talking about variables called local variables. There are actually a few different types of variables, and some need to be set using a different syntax. See “Types of Variables,” later in this chapter, for more information.

Once you’ve set a variable, you can use it as an argument for a command in Terminal (or in a shell script, discussed later in this chapter). However, to do so, you need to tell the shell that you want to use the variable name as a variable, rather than as simply the text in the variable name. (In other words, in the example given above, if you type the variable n, you want the shell to treat it as 1 rather than as simply the letter n.) You do so by preceding the variable with the dollar sign ($) symbol, as in $n. This is often called expanding the variable. (You can also surround the variable name with brackets for clarity, as in ${n}s, which tells the shell to "expand the variable n, and then follow it by the letter s," rather than $ns, which means "expand the variable named ns.")

Here are a couple examples of setting a variable and using it in a command:

(bash)
frakes$ n=1
frakes$ echo $n
 1
frakes$ echo "thumb${n}.jpg"
 thumb1.jpg

(tcsh)
frakes% set n=1
frakes% echo $n
 1
frakes% echo "thumb${n}.jpg"
 thumb1.jpg

With a value of 1 in the variable n, the argument thumb${n}.jpg is interpreted to mean thumb1.jpg.

If the value of n were always 1, using a variable would be silly. But variables and values can also be changed and used in arithmetic expressions. Here’s an example:

(bash)
frakes$ n=$(( n + 1 ))
frakes$ echo "thumb${n}.jpg"
 thumb2.jpg

(tcsh)
frakes% @ n++
frakes% echo "thumb${n}.jpg"
 thumb2.jpg

The above syntax tells the shell to set the variable’s value to “n plus 1”; in other words, it added 1 to the previous value of n—something programmers call incrementing. (In the tcsh example, I used shorthand syntax, available in that shell, that does the same thing.) Issuing these same two statements over and over again will produce a different value for thumb${n}.jpg each time.

Note

Each running instance of the shell has its own set of variables, independent of the variables in any other shell. Changing a variable in one shell has no effect on the variables in another shell.

Tip

Most variables live only within the context of the current shell; if you start a new shell, you’ll have to set those variable again. Because this would get quite tedious if you use a lot of variables (or a lot of different shells), you can create startup scripts that set variables and other shell attributes whenever a new shell is opened. I talk about this procedure later in this chapter in “Customizing Your Environment Across Shells.”

Viewing Variables

You can view a list of variables being used by your current shell by using the set command in Terminal without any arguments: set <RETURN>. When you do, you’ll probably be surprised by how many variables currently exist! You’ll see variables that contain your username (the one which you’re currently logged in as), your working directory (the directory in which you’re currently working in the shell), your default shell (bash, tcsh, etc.), and so on. As I explained above, these variables are collectively known as your shell’s environment.

For example, you’ve seen pathnames many times in this book that use the shorthand ~/ to indicate that the path that starts inside your home directory. (Thus ~/Documents really means /Users/username/ Documents.) How does the shell know that ~/ means your home directory and not some other directory? Because there’s a shell variable named HOME (home in tcsh) that has a value of /Users/username. In fact, you could just have effectively written your path as ${HOME}/Documents/.

Types of Variables

Broadly, there are three kinds of variables. Local variables (discussed in the previous section), environment variables, and ones I’ll call “system” variables.

Local and environment variables are actually very similar. (Don’t let the term environment confuse you; all variables affect your shell environment.) The only significant difference between the two is which programs get to “see” them. Whenever a program is started in Unix, the new process gets a copy of all of the environment variables of the process that started it. In contrast, local variables are never passed on. For example, the EDITOR variable—which tells the shell which Unix text editor you prefer—is an environment variable. If you execute the command crontab –e, which tells the shell that you want to edit a cron table in your Unix text editor, crontab starts up the editor designated by the EDITOR variable. crontab gets this variable from the shell. Consequently, if you change the value of the EDITOR variable in your shell, the crontab command will start a different editor the next time.

One other difference between environment and local variables is that you need to set environment variables using a slightly different command. In bash, that command is export VAR=value <RETURN>, whereas in tcsh, it’s setenv VAR value <RETURN>; VAR is the name of the variable and value is the desired variable value. (You use the $ character to expand environment variables, just as you do local variables.) Similarly, the command for viewing all environment variables is slightly different; instead of set, it’s env. (Thus, to see your environment variables, you’d type env <RETURN>.)

Here’s an example of the use of local vs. environment variables:

localhost:~ frakes$ remember='Order pizza'
localhost:~ frakes$ export PIZZA='Margherita'
localhost:~ frakes$ echo $remember $PIZZA
 Order pizza Margherita
localhost:~ frakes$ bash
localhost:~ frakes$ echo $remember $PIZZA
 Margherita
localhost:~ frakes$ exit
localhost:~ frakes$ echo $remember $PIZZA
 Order pizza Margherita

The first command set a local variable remember to the value Order pizza. The second command set an environment variable PIZZA to the value Margherita. Issuing an echo command returns the values of both variables (Order pizza Margherita). The bash command starts a second shell. However, when the echo command is issued again, only the value of the PIZZA variable is returned—the remember variable was local, so the new shell didn’t get it. Finally, the exit command terminated the second shell and returned you to the first shell; echo then again returns the values of both variables.

The last class of variables I call system variables. These variables are set or updated by the shell automatically. One of the most important is the current working directory. Whenever you type a filename or path in the shell, the shell first checks to see if you’ve typed a complete path. If so, it uses that path. However, if you don’t type a complete path, the shell prepends the full path to the current working directory to the file/path you’ve typed. For example, if my current working directory—the directory I’m currently “in” inside the shell—is /Users/frakes and I type the command ls Documents <RETURN>, the shell knows that I really mean /Users/frakes/Documents.

Note

Every process has its own working directory, so setting a working directory in one process doesn’t affect any others. In addition, when you start a program, it inherits the working directory of the parent process.

On the face of it, the working directory is just like any other environment variable. In fact, if you use the cd command to change it, you’ll see the value of the PWD environment variable (cwd in tcsh, although tcsh also has a PWD variable that’s automatically synchronized to cwd) change. But the cd command doesn’t just change the PWD variable. The working directory is maintained by the Unix operating system, not the shell; the shell simply "shadows" the value by updating the PWD variable whenever you change the actual working directory. What really happens is that the cd command asks the operating system to change the working directory and then updates the PWD variable to match. This makes it easy for you to see and use the value in the shell. But setting the PWD value to /Users (by issuing the command PWD=/Users <RETURN>) won’t actually change your working directory to /Users, just as changing the values for the USER or UID variables won’t change who you are logged in as.

Special Variables

Although you can create whatever variables you want, keep in mind that some variables (such as EDITOR) have special meaning, and some (such as PWD) are set by the shell automatically. Here are a few examples:

Variable | Type of Special Variable | Meaning
GROUPS (bash) | System variable | The list of groups to which your account belongs.
HOST (bash) | System variable | The Internet address of this machine on the network.
OLDPWD (bash) | Updated by the shell | The working directory that was set before the current one.
SECONDS (bash) | Updated by the shell | The number of seconds since the shell was started.
USER (bash) user (tcsh) | System variable | The short username of the current user.
PS1 (bash) prompt (tcsh) | Environment variable | The template used for the prompt displayed in the shell.
complete (tcsh) | Shell variable | If set to enhance, enables case- insensitive command and filename completion.
autolist (tcsh) | Shell variable | If set/enabled, automatically displays possible completions when <TAB> is ambiguous.
term | Shell variable | Declares the capabilities of your terminal window. If set to xterm or xterm-color, tells tools like less and top that there is a second display buffer for showing screens of information. When finished, the entire display is restored to where it was before the page(s) were displayed. If you don’t like this behavior, change your terminal emulation to vt102 via Terminal preferences. However, see the LESS variable (below) before you do.
LESS | Environment variable | Contains arguments passed to the less tool each time it’s run. less is used to display terminal output that spans multiple screens. less can be used alone, but it’s most often used by other programs such as man. Instead of "dumbing down" your terminal window by changing term (as described above), you can prevent less from using a secondary screen buffer by setting the LESS variable to --no-init (in tcsh: setenv LESS '--no-init' <RETURN>; in bash: export LESS='--no-init' <RETURN>). By taking this approach, other programs, such as top and pico, will continue to use a secondary display buffer.

Choosing Your Path

Another very important environment variable is PATH. Whenever you enter a command in Terminal, the shell has to find the program you used in the command. Just as Mac OS X likes it if all of your applications are in the /Applications folder, the shell searches for programs in only certain directories. You can keep your programs anywhere you like, but you have to tell the shell where to look for them. This is what the PATH variable does.

PATH contains a list of directories where the shell will look for commands. Usually, the PATH variable is set to something like /usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin. (PATH uses colons to separate different directories; thus there are five directories listed in that PATH value.) For example, when you type the command fsck <RETURN>, the shell first looks in the /usr/local/bin directory for a program named fsck. Not finding one, it then looks in the /bin directory, again coming up empty. Next it checks the /sbin directory, where it finds a program named fsck and executes it. (It never looked in /usr/bin or /usr/sbin because—just as you don’t bother looking in the bedroom after you’ve found your missing keys in the dining room—once it finds the desired program, it stops searching.)

What this means for you is that if you at some point install additional Unix programs, as long as you install them in one of the directories listed in your PATH variable, you need to specify them only by their program name. If you don’t install a program in one of these directories, you have two options. You can specify the full path to the program every time you use it from the shell. However, the (much) easier approach is to include the path to the program in your PATH variable.

For example, if you created your own (private) directory for Unix programs inside your home folder, at /Users/username/bin, you’d want to add the directory ~/bin to your PATH variable. Here’s how you’d do so:

bash: export PATH="${PATH}:~/bin" <RETURN>
tcsh: set path = ( $path ~/bin ) <RETURN>
bash or tcsh: setenv PATH "${PATH}:${HOME}/bin"

Now the shell will search your private ~/bin directory for commands.

Note

Actually, the shell uses the PATH variable only the first time it looks for a program. After a program has been found, the shell remembers its location. If you change the PATH variable and want the shell to use the new value, type hash –r <RETURN> (in the bash shell) or rehash <RETURN> (in tcsh).

Tip

To execute a program located in a directory not listed in your PATH variable, you have to use its complete path- name. (For programs in the current working directory, this is as easy as typing ./someprogram options arguments <RETURN>.)

Using the PATH Variable to “Replace” Unix Programs

Because the shell searches for commands using the PATH variable—in the order directories are listed in that variable—this means that if you have two commands with the same name, the one located in the directory listed earlier in the PATH variable will be run. You can use this mechanism to “replace” a standard Unix program included in Mac OS X with a different version (or with a different program altogether).

First, make sure the replacement program is named identically to the program you want it to replace. Then put the replacement program in a directory listed earlier in the PATH list than the directory containing the original program. The next time you type a command using that program, the shell will find the replacement before it finds the one that came with OS X.

An example of this technique is Fink software. If you install Fink (discussed later in this chapter in “Using Fink to Access Other Unix Applications”), you’ll notice that Fink includes its /sw directories early in the PATH list. This means that Unix tools installed by Fink will "replace" similarly named programs that came in OS X.

Tip

The shell’s which tool will tell you exactly which program a command will execute. For example, type which ls <RETURN> to see which program will run when you use the ls command in the shell.

An Alias, by Any Other Name…

There’s one last morsel that’s part of your shell’s environment: aliases. Not to be confused with an alias file in the Finder, a shell alias is simply an alternate name for a command (a program, a program with options and arguments, etc.). If an alias sounds a lot like a variable, that’s because it is—aliases are simply special kinds of shell variables that are used for issuing commands.

If you frequently use a particular command that’s either long or difficult to type (or both!), that command is a good candidate for an alias. For example, I like using the command ls -lhAFG to get a detailed listing of files that includes a few extra-nice formatting options. I use this command often, but it’s not the easiest, nor the quickest, command to type. So I’ve created an alias for it, ll. Now, whenever I want to get a listing of the items in the current working directory, I simply type ll <RETURN>, and I get my preferred format without having to type the messy command.

Here’s how you create an alias from within the shell:

bash: alias aliasname='command'

Example: alias ll='ls -lhAFG' <RETURN>

tcsh: alias aliasname 'command'

Example: alias ll 'ls -lhAFG' <RETURN>

To get rid of an alias (in either shell), you simply type unalias aliasname <RETURN>.

However, as I mentioned earlier in this chapter, most variables are shell-specific. That is, once you quit a shell, those variables are lost. If you’re creating aliases to commands, chances are it’s because you plan on using those commands frequently, and you’d like to have those aliases available in every shell. The way you do this is to create a shell startup script. I describe this process in the next section.

Customizing Your Environment Across Shells

Since most variables live only within the context of a running shell, if you start a new shell, you’ll have to set those variables again. Talk about a hassle! Fortunately, there’s a solution to this problem: a startup script. Not to be confused with the StartupItems or Login/Startup Items discussed in Chapter 3, shell startup scripts are scripts that run automatically when a shell starts. By placing commands in your startup script, those commands will be run every time a new shell is opened. (In Terminal, this happens every time you open a new Terminal window.) This also means that if you include in the script commands to set variables and to create aliases, those modifications to the shell’s environment will happen for every shell.

The question is which startup script to use—there are actually several that may be present on your computer. When bash starts, it automatically executes the commands in ~/.bash_profile, ~/.bash_ login, or ~/.profile. If you have more than one of these, the first one listed is executed and the others are ignored (kind of like the way the shell looks for programs in your PATH variable). In tcsh, the files are called ~/.tcshrc and ~/.cshrc. Again, if you have both, .tcshrc gets run and .cshrc is ignored. To save yourself from a lot of confusion, if you’re going to use a startup script, choose one file and get rid of the others.

You can edit (or create) your startup script from within Terminal (for example, using the pico text editor: pico ~/.bash_profile <RETURN>) or by using any Mac OS X text editor (such as TextEdit, TextWrangler, or BBEdit). You simply include each command on its own line. For example, if you add a command to the startup script that sets your PATH variable (as described previously), that command will be run every time you open a new shell, and thus your personalized PATH variable will always be used. (To test it out after saving your changes, open a new Terminal window and type echo $PATH <RETURN>; your new, modified, PATH variable will be displayed.

Tip

One drawback to using a Mac OS X text editor to edit your shell startup script is that because the script starts with a period, it’s invisible in the Finder. Some editors, such as BBEdit and TextWrangler, have an Open Hidden command that shows invisible files in their Open dialogs. Alternatively, you can use the open command in Terminal to open the script in your preferred text editor. For example, to open the ~/.tcshrc file in TextEdit, type open –e ~/.tcshrc <RETURN>.

Note

If you use a Mac OS X text editor to create or edit your shell startup script, check to see if it provides an option to save documents with Unix or Mac line endings. You want to make sure you use Unix line endings.

As you might have guessed by the fact that all of these different startup scripts are located inside your home directory, they apply only to shells started when you are the user. Shells started by other users in their own accounts won’t include the changes you include in your startup script. If you need to make changes to the shell environment for all users, you need to instead edit /etc/profile for bash or /etc/ csh.cshrc for tcsh. You’ll need root privileges to do this (i.e., by typing sudo pico /etc/profile <RETURN> or by opening your favorite Mac OS X text editor as root, as explained in Chapter 1).

Tip

The bash shell also has a script, ~/.bash_logout, that you can use to run particular commands whenever you exit a shell.

Putting Tools Together: The Beauty of Unix

Revisiting the LEGO analogy, up to this point you’ve just been looking at the pieces. You’ve put together a few pieces to create some interesting, well, things, but you haven’t come close to building a house. Just as it’s the ability to put LEGO pieces together that make LEGO interesting, if I had to sum up in a single sentence the power of the Unix shell, it would be this: The real power of Unix is the ability to put small tools together to make new ones.

Ins, Outs, and Pipes

LEGO parts can be snapped together because each part has a number of little round studs, matching sockets, or both. Any part with a socket can be connected to any part with a stud. The combinations are almost limitless. (In fact, according to the makers of LEGO, there are 102,981,500 different ways of combining six eight-stud bricks of the same color.)

So how do Unix tools go together? The first bit of magic is something called—rather dryly—redirection. Unix tools produce output (called stdout, or "standard out"), read from input (called stdin, or "standard in"), or do both. Whenever you run a Unix tool, stdin and stdout are always connected to something. Normally, stdin is connected to your keyboard and stdout to your console (Terminal window). So all of the output of the program goes to your window, and any input comes from your keyboard. But you can change this.

The > symbol redirects stdout to a file that you designate. Similarly, using two of this symbol together (>>) does the same thing, except that if the file already exists the output is appended to the end of the file rather than replacing the file. (This is very handy for writing data to logs.) Here’s an example of using stdout:

local:~ frakes$ echo 'To be or not to be'
 To be or not to be
local:~ frakes$ echo 'To be or not to be' > ~/Desktop/Hamlet.txt
 local:~ frakes$

In the first example, I didn’t redirect stdout, so the shell simply used the console and presented the output on-screen. However, in the second example, I told the shell to redirect stdout to the file named Hamlet.txt. If you followed along with this example, you’ll see that you have a new file on your desktop called Hamlet.txt that contains the output of the second echo command.

At the other end, the < symbol tells the shell to read the contents of a file (or the results of a command) for stdin. As an example, consider the wc command, which counts the number of characters, words, and lines in a file. You can type the "standard" command format to use your Hamlet.txt document as an argument:

local:~ frakes$ wc ~/Desktop/Hamlet.txt
 1 6 19 /Users/frakes/Desktop/Hamlet.txt

wc tells you that there’s 1 line, 6 words, and 21 characters in the file Hamlet.txt. However, like many Unix tools, wc will also work with the data from stdin if the command is run without any filename arguments; you can thus use stdin as a data source for wc:

local:~ frakes$ wc < ~/Desktop/Hamlet.txt
 1 6 19

These two commands look very similar, but only because I used the same file as an argument (in the first example) and as stdin (in the second). (Why you might use one approach over the other isn’t really important; what’s important is understanding what stdin is and how it works.)

At this point you might be saying, “So what?” Take a step back for a moment and consider that you can use stdout and stdin together: The shell can actually connect the stdout of one tool directly to the stdin of another! This functionality is called a pipe. The shell creates pipes using the | (vertical bar) character. The pipe basically tells the shell "pipe the preceding stdout into the stdin of the following program." For example:

local:~ frakes$ echo "To be or not to be" | wc
 1 6 19

In this case, the output of the echo program was piped directly to the input of wc, which then counted the words and output the results to its own stdout (which, since no alternative stdout was specified, was connected to the Terminal window). You could have just as easily redirected the output of wc to a file or piped it to yet another Unix tool.

For the Unix geek, stringing together tools can be addictive. As a “thought experiment,” consider the following command and its output:

local:~ frakes$ echo "To be or not to be" | tr '[:space:]'
~CA'\n' | sort -fu | wc –l
 4

Here, the echo command output To be or not to be to stdout. That data was piped to the tr command, which translates characters. The arguments '[:space:]' and '\n' told tr to translate (substitute) every space character in the input with a newline (carriage return) character. That caused each word from the input to be on a separate line in the output. This output was then piped to the sort program, which sorted the input lines into alphabetical order. (The -f option treats uppercase and lowercase letters the same, so that To and to are considered the same word, and the -u option eliminates duplicate lines.) The output of sort was a list of the words in the original phrase, To be or not to be, in alphabetical order—be, not, or, to. This was then piped to wc, which was told to only count the number of lines (via the -l option). The final output—which appeared on the screen—is that number.

What did I just do? I counted the number of unique words in the original phrase. Pretty cool, eh? Few word processors have the ability to count the number of unique words in a document, yet I did just that by stringing together four simple commands in Terminal. Leave off the wc command, and you’d have the start of an index! You could use other combinations to do grammatical analysis (comparing the number of unique words with the total number of words). The possibilities are endless.

Redirection: The “Fourth” Way of Quoting/Escaping

Earlier in this chapter, when I discussed quoting arguments, I mentioned that there was a fourth way of quoting and promised that I’d tell you about it later. Well, here we are. The shell can actually use redirection to capture the output of a tool and then use that output as arguments to another command. It does this via command substitution, which is a way of executing a command within another command, and you use the ` (backquote) character to do it.

When you type a command that includes backquotes, whatever is enclosed by backquote characters is first executed as a separate command. The output of that command is then captured and used as arguments to another command. Here’s an example that will output the last few lines (i.e., the “tail end”) of the single log file in the /var/log/cups folder that was most recently modified (the tail command outputs the last few lines of a designated file):

local:~ frakes$ cd /var/log/cups
local:/var/log/cups frakes$ tail `ls -t | head -n 1`
localhost - - [23/May/2004:09:37:45 -0700] "POST / HTTP/1.1" 200 220
localhost - - [23/May/2004:09:37:45 -0700] "POST / HTTP/1.1" 200 198
localhost - - [23/May/2004:09:37:45 -0700] "POST / HTTP/1.1" 200 219
 …

The shell first executed the ls –t command, which output all of the files in /var/log/cups in "time stamp" order—that is, the most recently modified files were listed first. This output was piped to the head command, which only echoes (to stdout) the beginning (head) of its stdin. The -n 1 argument told head how many lines to echo (in this case, one). The output of all of that was the single filename of the most recently modified log. That output—the filename—was then captured by the shell and substituted as an argument to the tail command, which then read the log file and output the last few lines, just as if I’d typed tail logname <RETURN>. (If I had changed the 1 in -n 1 to a larger number, such as 2 or 3, I could just as easily have seen the tail output of the two or three most recently modified log files.)

Tip

In the bash shell, you can also use the syntax $(command) in place of backquotes in order to perform command substitution.

Be careful if the output of your backquoted command would result in multiple arguments. Normally, the output is broken down into separate arguments just as though you had typed them in yourself. This can be a problem if some of the arguments contain spaces. In tcsh you can use the syntax "`command`" to have the shell automatically quote each line of the output as single arguments. Unfortunately, there’s no easy solution to this problem in bash. (See "Hiking Club Solution," later in this chapter, for an example of how to handle this problem in bash.)

Note

One final note: I oversimplified redirection a bit. Every tool actually has two output streams: stdout and stderr. The second, "standard error," is where most tools output error messages or diagnostics. If you redirect the output of a tool using |, >, or >>, the error messages from that tool will still be sent to your console (i.e., Terminal), and this is most likely what you want. In cases where you need to redirect stderr, too, use the syntax |&, >&, or >>& to redirect both stdout and stderr.

Everything’s a File

The designers of Unix were so enamored of this idea of redirection that they took it beyond just files. Unix tries, whenever possible, to treat everything like a file. More correctly, Unix tries to treat everything like a data stream—a file is just one kind of data stream.

You can find some of the more interesting data streams in the /dev directory. The "files" that you see when you list the /dev directory (via ls /dev <RETURN>) aren’t files at all; they’re names for both physical and logical devices. The console is here; your hard disks show up as disk0, disk1, and so on; and in the old days, devices such as modems, serial ports, and tape backup units would appear here. (Making a backup was just a matter of redirecting the output of a tool to /dev/tape0. In fact, the tar tool, used today to create portable archives, still carries this legacy in its name: tape archive.)

Today, most devices are too complicated to be treated as simple data streams. Nevertheless, there are still a few interesting devices in the /dev directory. /dev/null is a black hole for data. Anything output to /dev/null is simply thrown away. This is very useful if, say, you don’t care about the output of a tool, or maybe you don’t want to be bothered with any error messages—just redirect them to /dev/null. When used as input, /dev/zero produces an endless series of zeros. Similarly, /dev/ random produces an endless stream of random bits. For example—but I don’t recommend doing this—typing cat /dev/random > ~/Desktop/FillMeUp.txt <RETURN> in Terminal will rapidly fill up your hard disk with a massive file containing random data. (If you were crazy enough to try this command, press control+C to stop the cat program.)

Shell Scripts

The other way of putting Unix tools together is called scripting. A script is nothing more than a text file with some shell commands in it. The shell will read the commands included in the file and execute them just as if you had typed them in, one after another.

Shell scripts have some serious capabilities. First, it’s easy to use the shell’s control statements within a script. Control statements are shell commands that can make decisions and alter the order in which commands are executed. Second, a shell script is, essentially, a Unix tool! A shell script gets its own stdin and stdout, gets its own set of shell variables, and can even use arguments. You can use a shell script just about anywhere you’d use a binary Unix program. Use it from the prompt, in pipes, or from other scripts. When you create a shell script, you’re really writing your own Unix program.

You can write shell scripts using any text editor that writes “Unix” line endings (a single line-feed character at the end of each line). TextEdit, BBEdit, TextWrangler, or any of the Unix command-line editors (vi, pico, emacs) will all do the job.

The first line of any shell script is called a she bang line in Unix-speak. This special line of text, which begins with #!, tells the operating system which shell to use to interpret the rest of the script. Since the syntax of the tcsh and bash shells differ, it’s important that the correct shell be used. For example, here’s a very basic shell script:

#! /bin/bash echo 'Hello, World!'

This script, when run, basically outputs the text Hello, World! to the console.

Shell scripts generally end in the extension .sh. In addition, to be treated as a Unix command, a shell script has to be executable. This attribute is controlled by the executable bit of the file’s permissions. You would enable the executable bit via the command chmod ug+x scriptname <RETURN>. In the following example, I’ve enabled the executable bit on the script above and then run it from within Terminal:

local:~ frakes$ chmod ug+x hello.sh
local:~ frakes$ ./hello.sh
 Hello, World!
Warning

Be careful that you set the executable bit only on text files that are actually shell scripts. You don’t want the shell running amok trying to “execute” (run) your letter to Aunt Sally.

When you execute a shell script, you can include options and arguments in the command you use to run that script, just like any other Unix command. These appear (magically) in the script as special numbered shell variables: $0, $1, $2, and so on. $0 contains the actual command (./hello.sh in this example), and $1 is the first argument. The variable $# tells you how many arguments there were in total. Note that it’s up to you, the author of the script, to determine what kinds of arguments your shell expects (options, filenames, and so on) and what they mean.

Using Fink to Access Other Unix Applications

In addition to built-in Terminal commands/programs and shell scripts, there are two other great sources for Unix tools that will work in Mac OS X. First, a plethora of Internet sites have Unix programs compiled for OS X that are ready to run. The other, even better, is Fink (http://fink.sourceforge.net/). Fink is itself a program, but its main purpose is to help you find, download, install, and, if necessary, even compile open-source Unix projects.

Installing Fink is very easy. Fink was written specifically for Mac OS X, and comes with a standard Mac OS X installer. You just need to download the installer from http://fink.sourceforge.net/download/index.php, double-click the Fink Installer.pkg file, and then follow the instructions provided by the installer. Note that during the installation, the installer will open a Terminal window and may ask permission to modify your shell’s configuration files; allow it do to this. If you have any questions or problems during this phase, refer to the download page (above) for detailed help.

Note

At the time of this writing, there’s a minor conflict between Fink (v0.6.2) and OS X 10.3 that will cause to you get errors such as “Err file: local/main Packages File not found." To avoid this problem, after installing Fink 0.6.2, open a Terminal window and type sudo fink scanpackages <RETURN>. This needs to be done only once and will permanently fix the problem.

After installing Fink, open a Terminal window and issue the command sudo dselect <RETURN>. (Fink’s job is to install software; running it using sudo gives it the administrative powers required to do its job.) You’ll then be in Fink’s package manager. Use the up and down arrows (or press U) to select the [U]pdate command. Press the return key to execute it. Fink will then download from the Internet a list of all of the software it knows how to install. (Depending on the speed of your Internet connection, this could take a while.)

When Fink is done with the previous step, highlight the [S]elect command and press the return key. Read the instructions if you like; press the return key again to dismiss them. You’ll then be looking at the complete list of software packages Fink can install. This is also where you can see what Fink-provided software is currently installed on your Mac, select new software to install, or remove software previously installed. Use the up and down arrows to browse through the list of packages. Use shift+N and shift+P to move a page at a time. As you highlight each package, a brief description of the software appears in the lower half of the window. You can also browse descriptions of each package at http://fink.sourceforge.net/pdb/index.php. As you can see, Fink is the gateway to a lot of software.Once you’ve highlighted a package that you want to install, press the plus key (+, or shift+=). This tells Fink to install the selected package.

Note

If you get a “Dependency/conflict resolution” screen when you try to install software using Fink, this just means that the package you selected depends on other packages that haven’t yet been installed or that it conflicts with packages already installed. dselect will automatically calculate the actions needed to resolve the situation. Press the return key to dismiss the message, and then review the suggested actions. Press the return key again to accept the suggested resolution. This usually involves nothing more than selecting additional packages on which your chosen package depends.

After selecting the software to install, you’ll find yourself back at the package browser again. You can continue to select packages for installation, or you can mark packages for removal using the minus (–) key. When you’re done, press shift+Q to quit the browser.

Back at the main menu, highlight [I]nstall and press the return key to install the selected packages. Now Fink really gets to work. It will download all of the packages you marked to be installed, including any additional packages on which they might depend. After downloading these packages, Fink will "unpack" and install them in the correct locations. If Fink asks a yes or no question, type y <RETURN> to answer "yes."

Tip

If Fink’s terminal interface is a little too funky for your taste—and it sure is for me—try using the friendlier graphical interface provided by Fink Commander (http://finkcommander.sourceforge.net/). (Note that Fink Commander may actually be included on the Fink disk image; it was when I downloaded it.)

You should follow up any Fink [I]nstall by running the [C]onfigure and [R]emove commands. Most packages don’t need configuration, but run these steps just to make sure. When you’re all done, select the [Q]uit item and press the return key.

Start Sidebar
Hiking Club Solution

You now have all of the skills needed to solve the hypothetical hiking club website problem I presented at the beginning of this chapter (in the sidebar “The Power of the Shell”). Of course, I don’t expect that after reading this chapter you should be able to come up with the solution provided here off the top of your head! It includes a few subtle tricks that most people wouldn’t figure out without some practice working with the shell and scripting. However, it does demonstrate what you can do with fairly basic Unix tools.

The first step is to find a Unix program that will tell you what size a JPEG image is and resize it. Reviewing the available Unix tools that came with OS X, you find, well, nothing. There’s a tool called tiffinfo that has some of the features you need, but it works only on TIFF images. After some research, you find that the imagemagick package, available through Fink, has everything you need in order to manipulate your JPEG image files (and about 60 other formats, too!).

Using dselect or Fink Commander, find the package imagemagick-nox. In dselect, this can be rather tedious. Instead, in the [S]elect screen, type / to enter search mode, and then type magick <RETURN>. The next package containing the word magick will be highlighted. Repeat this until you’ve highlighted the package imagemagick-nox. (Don’t select the package imagemagick; that’s a larger package of tools that requires X11 to be installed. X11 is covered in a later section, so unless you want to read ahead, stick to the -nox—"No X11"—version.) Complete the installation of this package.

You now have a number of new Unix tools. The first one you’ll use is identify.

[local:~] frakes% cd Pictures/Grand\ Canyon/Hikes/Bass\ Esplanade/Apr-2003/
[local:Hikes/Bass Esplanade/Apr-2003] frakes% identify *.jpg
CamPic01.jpg JPEG 640x480+0+0 DirectClass 8-bit 173.4k 0.0u 0:01
CamPic02.jpg[1] JPEG 640x480+0+0 DirectClass 8-bit 142.9k 0.0u 0:01
CamPic03.jpg[2] JPEG 640x480+0+0 DirectClass 8-bit 147.4k 0.0u 0:01
CamPic04.jpg[3] JPEG 640x480+0+0 DirectClass 8-bit 75.2k 0.0u 0:01
CamPic05.jpg[4] JPEG 480x640+0+0 DirectClass 8-bit 206.6k 0.0u 0:01
CamPic06.jpg[5] JPEG 480x640+0+0 DirectClass 8-bit 231.4k 0.0u 0:01

identify determined the format and dimensions of each image file, plus a bunch of other information you don’t even need (or, most likely, understand). You can see that CamPic05.jpg and CamPic06.jpg are vertical images, whereas the rest are horizontal. (If you add the -verbose option, identify will output a whole screen’s worth of information about each image.)

The newly installed convert command will do the work of scaling the full-sized images down to thumbnails:

[local:Hikes/Bass Esplanade/Apr-2003] frakes% convert CamPic01.jpg -
Äresize 140x140 thumb01.jpg

The –resize 140x140 option/argument told convert to take the original image file (CamPic01.jpg), resize it so that it’s no larger than 140 pixels high or wide, and then write the new, smaller image to the file thumb01.jpg.

Now you’re going to create your own private bin directory and then create a new shell script using the pico text editor:

local:~ frakes$ mkdir bin
local:~ frakes$ pico bin/makeHikeClubThumbnails.sh

The pico text editor will appear; type in the following script (the numbers on the left are line numbers, not part of the file):

1 #!/bin/bash
2
3 hikeDir=~/Pictures/Grand\ Canyon
4 thumbDir=~/Desktop/HikeThumbnails
5
6 cd "${hikeDir}"
7 mkdir "${thumbDir}"
8 n=1 9
10 IFS=$'
11 for pict in `find . -name '*.jpg'`; do
12 IFS=$'
13
14 if (( `identify -format '%w > %h' "${pict}"` )); then
15 suffix=h
16 else
17 suffix=v
18 fi
19 thumb="thumb${n}${suffix}.jpg"
20
21 convert "${pict}" -resize 140x140 "${thumbDir}/${thumb}"
22
23 echo "${thumb}, ${pict}" >> "${thumbDir}/Thumbnails.txt"
24 echo "${pict} --> ${thumb}"
25
26 n=$(( n + 1 ))
29 done

Save the file by pressing control+O and then pressing the return key. Exit the editor by pressing control+X.

You should now make the script executable:

local:~ frakes$ chmod ug+x bin/makeHikeClubThumbnails.sh

Finally, you execute the script:

local:~ frakes$ bin/makeHikeClubThumbnails.sh
./Hikes/Bass Esplanade/Apr-2003/CamPic01.jpg --> thumb1h.jpg
./Hikes/Bass Esplanade/Apr-2003/CamPic02.jpg --> thumb2h.jpg
./Hikes/Bass Esplanade/Apr-2003/CamPic03.jpg --> thumb3h.jpg
./Hikes/Bass Esplanade/Apr-2003/CamPic04.jpg --> thumb4h.jpg
./Hikes/Bass Esplanade/Apr-2003/CamPic05.jpg --> thumb5v.jpg
…

After about 10 minutes, the script finishes, and you’ll find 2,000 thumbnail files in the HikeThumbnails folder on the Desktop. Each is correctly named with a v or h, and there’s a text document named Thumb- nails.txt that contains a comma-separated table of thumbnail and image names.

So how did it work? Let’s take the above script apart, line by line.

Line 1 The all-important “she bang” line.

Lines 3–4 Designates the directory that holds all of the source images and the directory where the final results will go. You assign them to shell variables so you can conveniently use them later.

Line 6 Changes the working directory to your image folder. All image filepaths/names are going to be relative to this folder.

Line 7 Creates the folder that will hold the thumbnails.

Line 8 Sets the thumbnail number variable to 1.

Line 10 This line is pure bash voodoo. See Line 11 for a description of what this line does.

Line 11 The for statement sets a shell variable (pict) to the values in a list of arguments. The pict variable is set to the value of the first argument in the list, and then all of the statements between the for and the done statements are executed. When that’s over, pict is set to the value of the second argument in the list, and the statements are executed again. The process repeats until pict has been set to every argument in the list.

The list of arguments is generated by the find command. By using `` quoting, the output of the find command is captured and then used as arguments to the for statement. Like any command, the shell separates arguments using space, tab, or newline characters; however, in this case, you don’t want that. Each line of output from find is a complete filename, and you want each line to be treated as a single argument, even if the filename contains spaces. To make the shell behave the way you want, on Line 10 you set the IFS (Internal Field Separator) shell variable; the shell separates arguments using only the characters contained in this variable. (Note that if you had been using tcsh, you could have skipped this; tcsh has a special syntax ("`…`") that quotes each argument correctly.)

Line 12 Normally, you do want the shell to split arguments based on spaces and tabs. Now that you’re done tricking the shell into splitting up your list of filenames correctly, you set the IFS variable back to its normal value.

Lines 14–17 You want to determine if the image is wider than it is high. The if statement lets you test conditions and alter execution based on the results. You use the ((…)) syntax to test an arithmetic condition. Again, you use output redirection to capture the output of a tool and use that output as arguments in the expression. The identify tool has a -format option that reports information about an image using a template that you supply. The %w in the template will be replaced with the pixel width of the image; %h will be replaced with its height. So if the dimensions of the image are 480 ´ 640 pixels, then %w > %h will output 480 > 640. This output gets captured by the shell, and the if statement is executed as though you had typed if (( 480 > 640 )); then. (The shell knows that this is an arithmetic expression and that > means "greater than," not file redirection.) If the expression in the if statement evaluates to true, the statement is executed. Thus, if the width is larger than the height, you set the suffix shell variable to h (for "horizontal") via Line 15. If the expression doesn’t evaluate to true, the else conditional (Line 16) is executed, and you set the suffix shell variable to v (for "vertical") via Line 17.

Line 19 You now have enough information to create a thumbnail filename. The file is going to be a combination of the thumbnail number and the vertical/horizontal suffix you determined using the identify tool. Since it consists of several parts, and you’re going to use it more than once, you assign it to a shell variable (thumb) for ease of use.

Line 21 You can now run the convert tool to resize the original image file and write it to the new thumbnail file.

Line 23 To keep track of the two files, you use the echo command to format a single line of text consisting of the name of the thumbnail file and the name of the original image file. The >> redirection operator appends that line to the end of the Thumbnails.txt file.

Line 24 Just so you can watch the progress of the script, you output a status message to the console.

Line 26 Finally, you increment the value of the n variable so the next thumbnail will get a different filename.

Generalizing Your Thumbnail Tool

You’ve just written a custom Unix program that solved the specific problem of the hiking club. But you don’t have to stop here. What if you wanted to convert just one subdirectory, or a small group of subdirectories, of images to thumbnails? What if you had several projects and needed to perform the same conversion on each? You could edit Lines 2 and 3 of the script before running it each time, but that would be tedious.

Instead, you can edit the script to require a single argument, which would be the directory tree containing the JPEG images.

1 #!/bin/bash
2
3 hikeDir="$1"
4 thumbDir=~/Desktop/HikeThumbnails

Now, the hikeDir variable will be set to whatever argument is passed when you execute the shell. Here’s an example:

[local:~] frakes% bin/makeHikeClubThumbnails.sh ~/Pictures/Grand\

ÄCanyon/Hikes/Cheops/

./200201071750057.jpg --> thumb1v.jpg

./200201071750077.jpg --> thumb2h.jpg

./200201071750079.jpg --> thumb3h.jpg

./200201071750105.jpg --> thumb4h.jpg

./200201071750127.jpg --> thumb5h.jpg

The script processed only the JPEG images in the ~/Pictures/Grand\Canyon/Hikes/Cheops/ directory included in the command. In fact, by editing Line 4, you could use a second argument to specify the name of the thumbnails folder via the command line. With a bit of fancy scripting, you could even make the arguments optional, or output an error message if an argument was missing.

The above exercise wasn’t trivial—it did require an understanding of how various Unix tools can be combined to make more powerful tools. However, I hope after reading this chapter and following along with this example, you’ve at least gotten a feel for the power of the shell. If it still feels like writing shell scripts is over your head, don’t worry; you’re not alone. Many Unix system administrators make a good living using only the shell and an in-depth understanding of Unix tools and architecture!

End Sidebar


Beyond the Basics: Other Unix Tips

I don’t want to scare you, but this chapter has only scratched the surface of what you can do with Unix. Like the ancient game of Go, Unix takes “minutes to learn, a lifetime to master.” I didn’t delve into many details and subtleties of the shell. I didn’t even mention variable macros, background job control, shell functions, built-in commands, command history, completion status codes, or conditional execution. (You may be thinking, “And I’m glad you didn’t!”)

If this chapter was your first real introduction to the shell and OS X’s Unix underbelly, and you’re thirsting for more, I highly recommend getting a good book dedicated to the subject. The bulk of any book that covers BSD Unix and the bash or tcsh shells will be applicable to OS X. (The only caveat is that if you don’t get a book specifically for Mac OS X, it won’t include discussion of Mac OS X– specific Unix tools.) Mac OS X Unleashed, by Ray and Ray, is an excellent Mac OS X book that is weighted heavily toward Unix-related topics; alternatively, O’Reilly’s Unix Power Tools (no relation to Mac OS X Power Tools) is one of the better guides to Unix on the market.

Below are a few additional tips and recommendations for getting help with and exploring Unix in OS X.


Everybody Needs a Little Help Sometimes, man

One great thing about using a shell is that once you’re comfortable with the basics, the details of most commands are documented right in the shell via man pages (short for manual). The man command will look up and display the documentation for most commands. For example, here’s part of the man page for the ls command:

local:~ frakes$ man ls
LS(1) BSD General Commands Manual LS(1)

NAME
 ls - list directory contents

SYNOPSIS
 ls [-ABCFGHLPRTWZabcdfghiklmnopqrstuwx1] [file …]

DESCRIPTION
 For each operand that names a file of a type other than directory, ls
 displays its name as well as any requested, associated information. For
 each operand that names a file of type directory, ls displays the names
…

If you don’t know which command to use, the apropos and whatis tools will search the short description of every man page for keywords. apropos searches for any string whereas whatis matches complete words. Here’s a whatis search for the word virtual:

local:~ frakes$ whatis virtual
lsvfs(1) - list known virtual file systems
vfork(2) - spawn new process in a virtual memory efficient way
virtual(5) - format of Postfix virtual alias table
virtual(8) - Postfix virtual domain mail delivery agent
vm_stat(1) - show Mach virtual memory statistics
vmmap(1) - Display the virtual memory regions allocated in a process

The number in parentheses is the section the page is in. Section 1 contains Unix tools, which you’re likely to use from the command line, and is the section you’re most likely to be looking up. Section 5 documents the format of files, such as configuration files and scripts. Section 8 explains “system” programs, which are only rarely used from the command line. The remaining sections are mostly of interest only to programmers. In the above example lsvfs, vm_stat, and vmmap are command-line tools of interest. If you want to get more information about virtual(5) using man, issue the command man 5 virtual <RETURN> to distinguish between the man pages for virtual(5) and virtual(8).

The man command normally pipes its output (remember pipes?) automatically to the more (or less) tool, which allows you to scroll up and down, and even search. However, the truth is that reading man pages in Terminal can still be cumbersome. A graphical, Mac OS X program such as Xman- View (http://www.versiontracker.com/dyn/moreinfo/macosx/10555) or ManOpen (http://www.clindberg.org/projects/ManOpen.html) will be much easier to use. Both even include Unix tools that will let you open a man page in the application from within Terminal.

Start Sidebar
Tips for Mastering the Shell

As you’re exploring the world of the Unix shell, keep these tips in mind:

  • Man pages are your friends. They might seem terse and arcane, but most of them were written by the same programmers who wrote the tools and are considered the definitive reference guide to each tool.

  • See what other people have done. Open script files and read them. The /etc/rc scripts are the ones that OS X executes when it begins to boot. If you can understand these scripts, you’ll know a lot about shell scripting.

  • Don’t be afraid to experiment, unless the command you’re issuing is intended to delete or destroy something. (Even then, you have a backup, right?) Most Unix programs can be stopped (killed) by pressing control+C in the shell. Try your command on a test file or directory until you’re sure it does what you want.

  • When piping several tools together, start by redirecting the output of the first command to a file. Open the file in a text editor and look at it. Then redirect that file as the input to the second command. Examine that command’s output. Keep this up until you’re sure that you understand all of the intermediate steps, then pipe them together directly.

  • Use echo to view the contents of shell variables, or to announce the progress of scripts.

  • Start small. Build up multiple commands and scripts in small steps. When you first start writing and testing for loops and if conditionals, use the echo command to verify that they’re working the way you intend. When you’re sure the loops and conditionals work, add the actual commands to go with them.

  • Try alternative solutions. There are usually at least two, and probably a dozen, different ways of accomplishing the same thing.

  • Ask for help. There are websites, discussion lists, and forums filled with experienced Unix users who are more than willing to help anyone trying to learn. You’re unlikely to discover tricks (such as setting the IFS variable, used in the “Hiking Club Solution” sidebar) on your own. And if you did, wouldn’t you want to share them with others?

End Sidebar
Tip

You’ll occasionally encounter a Unix program that doesn’t have a man page. Note that many programs will output a synopsis of how to use them—to stdout, which means the synopsis will be shown in Terminal—when run with the –h option, the --help option, invalid arguments, or without any arguments at all. Which to use varies from one program to another and usually requires some experimentation.


Unix Tools to Explore

I’ve spent most of this chapter talking about the shell. However, there’s a lot more to the Unix found on your Mac. Here are some interesting and useful Unix tools of which you can take advantage.

Editors

Editors in Unix run the gamut from the simple to the bizarre. You can access most of them from the shell by simply typing their names as a stand-alone command.

The granddaddy of all Unix editors is vi. Although it’s extremely powerful, it’s the antithesis of "intuitive." (If you should ever find yourself in vi accidentally, type :q! <RETURN> to exit. Intuitive, right?) Even more powerful, and slightly easer to use, is emacs. (If you find yourself stuck in emacs, press control+X, then control+C, and then answer the questions to exit.)

For casual editing, pico is the editor of choice. You can move around using the cursor keys. Anything you type is inserted. The principle commands are always listed at the bottom of the screen. The ^ character is Unix shorthand for the control key. Pressing control+O "writes Out" (saves) the document, and control+X "eXits" the editor. Other commands can be found using the control+G (Get help) command.

If you do a lot of editing from Unix, you’ll appreciate the world-class text editors BBEdit and TextWrangler (http://www.barebones.com/products/index.shtml), which I’ve mentioned a number of times throughout this book. Both install a helpful Unix tool that lets you open a file in the text editor from within the shell. (For example, the BBEdit command format is bbedit filename.) You can even set this tool as your default editor via the EDITOR shell variable; any Unix application that needs you to edit a file will open that file in a full-featured Mac OS X editing window.

The cron Command

I discussed cron, and even showed you how to edit crontabs (cron schedules), in Chapter 14. I mention it again here because it’s actually a Unix tool. Type man cron <RETURN>, man crontab <RETURN>, and man 5 crontab <RETURN> for more information.

Mac OS X Tools

Mac OS X comes with several shell tools for interacting with the “normal” parts of OS X with which you’re probably more familiar. Here are a couple very useful ones:

open The open command opens a document, application, or URL just as if you had double- clicked it in the Finder. The -e option opens the document in TextEdit. You can use the -a option to open a document in an alternative application; this is equivalent to dragging the document and dropping it onto (or into) that application. As an example of this functionality, if you have a "To Do" list in your Documents folder, you can have that document open every morning at 9 A.M. by adding the command open/Users/username/Documents/ToDoListName to your crontab. (See the previous section, and Chapter 14, for more information about crontabs.)

osascript The osascript command executes an AppleScript, whether it’s a single AppleScript command or an entire AppleScript program. For example, osascript -e 'set volume 0' <RETURN> will mute your computer’s speaker right from within Terminal.

Note

AppleScripts can also execute shell commands. Combine the two, and there’s a lot of potential for mixing Unix tools with scriptable applications.

Commands for Working with Files

As you might expect, there are many programs in Unix that work with, and on, files and file data. You’ve already used ls, find, sort, and wc. Here are some more:

CpMac and MvMac Although Mac OS X is at its heart a Unix operating system, it also inherits attributes of the Classic Mac OS. One concept foreign to Unix is that of resource forks, used extensively in Mac OS 9 and earlier to store structured data. Even though the use of resource forks is rapidly fading, there are still many files (including all Classic applications and most documents created in those applications) that have them. If you copy or move a file using the standard Unix tools (cp or mv, respectively), the resource fork will be left behind. Apple’s CpMac and MvMac tools—installed as part of the Mac OS X Developer Tools—are equivalent to the Unix cp and mv tools but will correctly copy resource forks and metadata as well. (Note: In terms of the mv command, if you’re just using mv to move or rename a file within the same volume, resource forks will be preserved. It’s only when mv is used to copy a file from one volume to another that the resource fork will be lost and you should instead use MvMac.)

ditto The ditto command duplicates entire directory trees, preserving ownership, privileges, and (when used with the -rsrc option) resource forks. You can use ditto to make backups and even create bootable OS X volumes. The excellent Carbon Copy Cloner (http://www.bombich.com/software/ccc.html) utility is little more than a graphical user interface for the ditto tool.

lsof The lsof command lists open files. If OS X ever tells you that it can’t do something, such as empty the Trash, because a file is "in use," use lsof to find out what application or processes has it tied up.

df The df command displays the amount of free disk space for Unix mount points. df -Hl <RETURN> will produce an easy-to-read summary of all mounted volumes and tell you how full each one is.

du The du command is similar to df, but it totals up all of the disk space occupied by individual files. du -ks ~/Documents/* <RETURN> will list the amount of space (in K) used by each file and folder in your Documents folder. This is like using Get Info on each item in the Finder, or turning on Calculate All Sizes in the List view options for that Finder window—just a lot faster. Like most Unix tools, du knows nothing of Macintosh resource forks. Any data in resource forks will not be tallied.

grep The grep command searches text for patterns, using something called regular expressions. Like globbing in the shell, it’s a way of describing a pattern, except that regular expressions are far more complex than the simple wildcards used by the shell. You can find a pretty good description of regular expressions in the man page for grep although a complete explanation would make a small book. If you want to avoid regular expression syntax, use fgrep to search for literal strings. Grep is very often used in pipes to strip off output you don’t care about (ps -x | grep Terminal <RETURN> finds the process status of Terminal) or to find something in a group of files (grep ntp /var/log/*.log <RETURN> searches all of the .log files in the /var/log directory for any entries containing ntp, which are likely to be Network Time Protocol messages).

Disk Utilities

Mac OS X provides a few Unix tools to work with disks and volumes; here are the most important:

fsck The fsck command provides a File System ChecK. fsck is the principal disk repair program in OS X; it’s even used when you run OS X’s Disk Utility. You can use it from single-user mode at startup (as described in Chapter 14) to repair your startup volume.

diskutil Want to eject a CD, or format, rename, verify, or repair a volume? Much of what the Disk Utility application does is actually accomplished using the diskutil program. But be careful using this command—diskutil can do some powerful things, such as erase entire volumes.

hdiutil The hdiutil command manipulates disk image files. Most of the functions of Disk Utility that aren’t handled by the diskutil command (and most of what the Disk Copy utility in OS X 10.2 and earlier does) are handled by hdiutil. Use hdiutil to create, mount, unmount, or compress a disk image.

Network and Internet Tools

If you’re the type who likes to fool around with networks and network packets, here are some of the more useful network- and Internet-related tools:

ifconfig Not really a single command, ifconfig is actually a network configuration tool composed of a complex set of shell scripts. It displays information about, and allows you to change, your network ports. However, this is another tool you want to be careful using—changing things about your network using ifconfig could confuse, or conflict with, Mac OS X’s Network preference pane.

tcpdump The tcpdump command captures network data (also called sniffing). Ever wondered what data your Web browser is sending to a server? Issue the command sudo tcpdump -X -s 512 tcp dst port 80 <RETURN> in Terminal, and then go load a Web page in your browser. Press control+C to stop tcpdump when you’re done.

netstat,, ping,, lookup,, traceroute,, whois,, finger The netstat, ping, lookup, traceroute, whois, and finger commands can all be run from their eponymous tabs in the Network Utility application included with Mac OS X. However, using them from the command line gives you access to the dozens of other features and options that Network Utility doesn’t provide.

curl The curl command simply downloads a URL. It will download via HTTP, HTTPS, FTP, and several other protocols, which makes it a convenient way of grabbing a single file, image, or Web page from the Internet. What curl downloads is output to stdout, so you’ll want to redirect stdout somewhere to save it. Unless, of course, you just want to look at the source of a Web page, or the contents of a text file, in Terminal.

ftp As I mentioned in Chapters 10 and 11, when you use an FTP client, you’re really using a graphical interface to the Unix ftp program. You can instead use the ftp program in Terminal by typing ftp <RETURN>. Once you start it and connect to a server, you enter ftp commands until you’re done. Enter the bye or exit command to return to the shell. You might use ftp if you don’t have a graphical FTP client handy or if you’re having connection problems. If you don’t have an account and password on the FTP server to which you’re connecting, use the -a option to perform an "anonymous" login.

nmap The nmap command isn’t actually included in OS X but can be installed using Fink (described earlier in this chapter). A powerful network analyzer, nmap can tell you what services are running on a particular computer and can even make an educated guess as to what operating system that computer is running. It’s also useful for debugging network configuration problems. More information on nmap is available from http://www.insecure.org/nmap/.

analog The analog tool—not installed by default but also available via Fink—is a powerful website traffic analyzer. It can produce detailed information on Web server usage patterns, in the form of text files and easy-to-read graphs that can be viewed in any Web browser. Many system administrators set up a cron job to run analog every night, or at least once a week, so that website usage statistics are always available.

Printing Tools

A number of Unix tools also exist that allow you to print documents from the shell.

lpstat The lpstat command displays the status of printers and print jobs.

lp The lp command sends print jobs to printers. You can use lp to print files or stdin. For example, ls -l | lp <RETURN> will print a listing of the current directory, whereas lp ~/Desktop/Report.pdf <RETURN> will print a PDF document called Report.pdf located on your Desktop. Note that lp generally understands only plain text, PDF, and PostScript files. Word processing and image files will have to be printed from an application that understands them or will have to be first converted to PDF or PostScript.


Compiling and Installing Unix Programs

In Chapter 4, I covered how to install Macintosh applications. These applications are invariably precompiled, ready-to-run programs. Likewise, any pre-compiled Unix programs that you download for Mac OS X can be installed simply by copying them to a suitable location (presumably a directory listed in your PATH variable).

However, whereas the Mac OS runs on one particular hardware platform (Apple computers), the Unix operating system runs on a wide variety of processors and computer platforms. To distribute a working program that would be immediately usable by all Unix users, a software developer would have to compile their program for every combination of processor and Unix imaginable. (Compiling is the process of taking a program’s source code—the actual code in which the program is written—and preparing it so that it actually runs on a particular hardware/software platform.) Not only would this be tedious, but it would also be impractical since it would require that the developer actually own many of those systems. (You generally can’t compile a program for one hardware/software platform from another platform.)

As a solution, most Unix applications have traditionally been distributed as raw source code via what are called source kits. You download the kit and then compile the program for your specific machine and “flavor” of Unix. (There are many different kinds of Unix, and they’re usually referred to, in Unix-speak, as being different flavors.)

Note

If you want to compile anything—and this includes having Fink compile software for you—you’re going to need a compiler. The gcc compiler (http://gcc.gnu.org/), which is probably the most popular one, isn’t included in the standard installation of Mac OS X. However, you can get it by installing the OS X Developer Tools, as described in the Introduction to this book. (The Developer Tools provide a wealth of tools, some nifty utilities such as icon and property list editors, and tons of documentation.)

Alternatives to Compiling: Ports

Unfortunately, although the compiler takes care of the translating the source code into machine instructions appropriate for your CPU, differences in operating systems (and, occasionally, differences in compilers) have to be addressed in the source. A program that will compile on one variant of Unix might not compile on yours.

The solution to this dilemma is for someone, or some group, to make changes to a program’s source code so that it will compile and run on another operating system. This process is called porting, and a program that’s so changed is called a port.

Ports are handled in two different ways. One is to include different sets of code right in the source. When compiled on OS X, the source would then know to compile in a different way than it would if compiled on, say, a Linux system. Alternatively, the programmer(s) doing the porting can create a patch. A patch is essentially a list of changes required to turn a particular version of a program into one that will compile for another platform. You’d download the original source and the patch and then use a patch program to make all the changes required. These lists of changes are often called diffs because programmers use the diff (difference) tool to generate the concise list of changes that need to be made.

Fortunately, most source kits and ports are scripted, meaning that shell scripts do all the aforementioned drudgery for you. In fact, many scripted source kits and ports have been turned into packages, which is what Fink uses. Packages are either binary or source kits that Fink can download, patch, compile, and install automatically. It’s one-button software engineering!

If you encounter a program that’s available only in raw source form, here’s the common convention for compiling and installing it:

  1. Download the software bundle. Unarchive it if necessary using StuffIt Expander or an appropriate Unix tool, such as tar.

  2. Take a look at what you downloaded. If there are README, INSTALL, or other documentation files, read them. Most include step-by-step instructions for how to build and install the program. If they don’t, or if they gloss over the details of compiling and installing, then they probably assume the following steps.

  3. In the shell, cd to the directory containing the package. Issue the command ./configure <RETURN> to run the configuration script. This script should examine your system to determine if everything the software needs to compile is present, apply any patches, and prepare the software for compilation. If it can’t, it should tell you what’s wrong or what’s missing.

  4. Issue the command make <RETURN>. make is a Unix tool that "makes" software—it runs whatever compilers, linkers, and scripts are needed to assemble the application. Sit back, and watch the magic.

  5. Once the application is successfully built, type sudo make install <RETURN>. This tells make to install the application into its usable location, often the /usr/bin directory. You shouldn’t need administrative privileges to compile the program, but you often need them to install the results (the compiled application), which is why you ran make install separately using sudo. If the installer places the new software in a directory such as /usr/local/bin or /sw, make sure this directory is in your PATH variable.


X11

Without sounding too much like a Macintosh snob, it’s safe to say that before Mac OS X there were no “good” graphical user interfaces for Unix. That’s not to say that there weren’t any at all. For example, the most common windowing environment for Unix is the X Window System, or X11 for short. X11 runs on many different flavors of Unix and provides a graphical interface to X Window–compatible Unix applications.

You can run these X Window applications under Mac OS X by installing X11. Although there are several X11 implementations for Mac OS X, the easiest one to install (and by far the best looking one) is provided by Apple. If you did a custom install of Mac OS X and chose to install X11, it’s already on your hard drive (in /Applications/Utilities); if not, you’ll need to install it manually. You can do so by inserting Mac OS X Install Disc 3, opening up the Packages folder, and then double-clicking the X11User.pkg file. Follow the installation instructions.

Alternatively, you can also install an OS X port of the XFree86 X Window system via Fink. The Fink project provides excellent information on installing XFree86—and for using Apple’s X11 implementation with other Fink-installed programs that need X11—at http://fink.sourceforge .net/faq/.

One conceptual difference between X11 and the graphical user interfaces that you’re used to (e.g., Mac OS or Microsoft Windows) is that X11 is designed to run programs on another computer. (It’s kind of like the VNC solutions I described in Chapter 11.) As you read about X11 “servers” and “clients,” understand that you will be running both on your local computer. But X11 is perfectly capable of running X11 applications on another computer that’s running X11, too. This is fantastic for scientists or telecommuters who would like to use their Macintosh to run Unix applications remotely. The easiest, and most secure, way of running X11 applications remotely is by using SSH tunneling. Doing so can also avoid problems with firewalls and routers. (ssh has a mode, -X, just for X11 tunneling. The man page for ssh describes X11 tunneling.)


Moving On...?

Team LiB

Moving On…?

You’ve come a long way since the Introduction. If you’ve mastered the previous 14 chapters and this one (who am I kidding…even if you haven’t mastered this one), you can surely be considered a “power user” and the master of your Mac. If you’re still craving knowledge, be sure to check out Appendix A, which discusses using multiple volumes and disk partitions in OS X, and the Online Appendix, which provides some good tips for moving from OS 9 to OS X, and switching between them.


Appendix A: Multiple Mounts, Various Volumes, and Divided Disks

(Or: Everything you wanted to know about multiple hard drives, disk partitions, and removable volumes, but were afraid to ask.)

Overview

Although most Macs come with a single hard drive, pretty much every Mac user will at some point work with multiple mounted volumes—the technical term for hard drives, removable media, and even disk images. In addition, many users partition their hard drive(s), which is a way of making a single drive appear as multiple drives. Although OS X, like any modern operating system, fully supports as many volumes as you can manage to mount, working with non-boot volumes (those volumes that don’t host the copy of OS X used to start up your Mac) is a bit different than working with the boot volume. In fact, although the Mac OS has always had a few quirks when it comes to working with multiple volumes—especially for new users—Mac OS X has additional considerations that make using multiple volumes a bit more challenging.

In this appendix I talk about some of the issues and quirks that arise when working with multiple volumes. I also talk about drive partitioning, including why you might want to do it and how to actually go about it. Finally, I discuss a couple of ways to customize OS X when using multiple volumes— by moving user directories and/or your system swap files to non-boot volumes.


Working with Multiple Volumes in OS X

From the standpoint of the user, a volume is any disk, drive, partition, image, or server that appears on your computer as a location for data storage. (In many cases, a volume is equivalent to a hard drive, a CD, or a disk image.) However, from a technical standpoint—that is, the way OS X sees things— a volume is any separately identifiable unit of data storage. If you have a single a hard drive that has been divided into two or more partitions, OS X sees that hard drive as multiple units of storage and mounts those units as separate volumes.

To view all volumes available to your Mac, open a new Finder window to the Computer level (by choosing Go Ø Computer or pressing shift+command+C). If you have only a single drive with a single partition, and no removable media or servers mounted, all you’ll see is your hard drive. However, if a CD or DVD is in your Mac’s optical drive, if you have a server mounted, or if your hard drive is partitioned, you’ll see multiple volumes.

If you’re interested in the technical details behind these volumes, under OS X 10.2 and earlier you can type sudo autodiskmount -v <RETURN> in Terminal; you’ll see a list of currently mounted volumes. If you’re using OS X 10.3 or later, the autodiskmount command doesn’t work; instead, type disktool -l <RETURN>. The output is a bit different, but it provides similar information. As an example, below are the results of the OS X 10.2 command on one of my computers:

/Users/frakes % sudo autodiskmount -v
Password:
DiskDev    FileSys   Fixed   Write   Volume Name     Mounted On
disk0s9    hfs       yes     yes     SystemX         /
disk0s10   hfs       yes     yes     System9         /Volumes/System9
disk0s11   hfs       yes     yes     Scratch         /Volumes/Scratch
disk1s9    hfs       yes     yes     SystemXBackup   /Volumes/SystemXBackup
disk1s10   hfs       yes     yes     iTunes          /Volumes/iTunes
disk3s9    hfs       yes     yes     Backup          /Volumes/Backup
disk5      hfs       no      yes     Test Image      /Volumes/Test Image

The first column lists the device ID, which is a way for OS X to keep track of which disk is which. In this case, disk0 is the first internal hard drive, disk1 is a second internal hard drive, disk3 is a FireWire drive, and disk5 is a mounted disk image. In addition, some disks have multiple volumes. For example, disk0, the boot drive, has been partitioned into three volumes: SystemX, System9, and Scratch. The second internal hard drive, disk1, is also partitioned into two volumes, SystemXBackup and iTunes. The display also tells you how each volume is formatted, whether it’s fixed or removable, whether it’s writable, the name of the volume, and, finally, where the drive has been mounted in terms of OS X’s filesystem. (I’ll talk about this location in the next section.)

Although my drive setup is a bit more complex than most, you don’t have to be a high-end user to work with multiple volumes. Any time you insert a CD, DVD, floppy, or magneto-optical disk; connect to a file server; mount your iDisk; or even mount a disk image, you’re mounting a new volume, and you need to be aware of how working with files on multiple volumes differs from working with files on a single volume.

Accessing Non-Boot Volumes

User Level | any
Affects | individual user
Terminal | n/a

Before I get into some of the issues that come with using multiple volumes, here’s how you actually access files and folders that reside on non-boot volumes from the Finder, in Open/Save dialogs, and from within Terminal.

In the Finder If you’ve checked the boxes next to “Hard disks,” “CDs, DVDs and iPods,” and “Connected servers” for the “Show these items on the Desktop” options in Finder preferences, any mounted volume will show up on your Desktop. Likewise, in OS X 10.3 or later, if you’ve enabled “Hard disks,” “iDisk,” “Connected servers,” and “Removable media (such as CDs)” in the Side- bar panel of Finder preferences, any mounted volume will show up in the sidebar of Finder windows. (Alternatively, you can just enable the Computer item, which, when clicked in the sidebar, presents you with a list of mounted volumes.) If you’ve unchecked any of these boxes, another way to access such volumes is to open a new Finder window and choose Go Ø Computer, press shift+command+C, or click the Computer item in the toolbar, if present. This Computer view will present all mounted volumes, along with the Network icon, in a single Finder window. You can then access any volume as you would your boot volume or a folder.

Note

In Mac OS X 10.3.0 through 10.3.2, if you “mount” a network volume/sever/share by browsing the Network item in the Finder (as explained in Chapter 11), these items do not show up on the Desktop or in Finder sidebars. You need to access them via the Network item every time. Apple fixed this inconsistent behavior in OS X 10.3.3 and later.

In Open/Save dialogs From within Open/Save dialogs, you can access any volume via the file browser (which is probably visible in your Open/Save dialogs by this point in the book, but, if not, is accessible by clicking the downward-pointing triangle). In OS X 10.3 and later, the sidebar in Open/Save dialogs reflects Finder sidebars, so you may see mounted volumes immediately. If you’ve chosen not to show some or all mounted volumes in the sidebar, press command+up (the up arrow key on the keyboard) repeatedly until you’re at the Computer level, or press shift+command+C to immediately switch to the Computer view. (If you’re running OS X 10.2 or earlier, simply click the horizontal scrollbar at the bottom of the file browser, and drag it all the way to the left. You’ll see a list of all mounted volumes, which you can then browse.)

Note

The note above—about volumes mounted via browsing the Network item in the Finder—applies to Open/Save dialogs, as well. To access these volumes in OS X 10.3.0 –10.3.2, you need to access the Network item (via the sidebar or by navigating to the Computer view and accessing the Network icon from there) and then browse to the network volume. This behavior is also fixed in OS X 10.3.3 and later.

From within Terminal Accessing volumes via the Finder and Open/Save dialogs is fairly intuitive since volumes are generally hard drives, CDs, servers, etc., so it follows that you would access them at the top level of the Finder and file browsers. However, accessing non-boot volumes in Terminal is a bit different. If you flip back to the example I provided using the autodiskmount command, and then look at the Mounted On column of the Terminal output, you’ll see why. The boot volume is always located at / whereas non-boot volumes are located in /Volumes. So to access a non-boot volume in Terminal, you need to use the path /Volumes/volumename. For example, using the volumes in that example, if I wanted to save the output of the manual page for the mv command to a file named mv.txt on the disk named Scratch, I’d type man mv > /Volumes/ Scratch/mv.txt <RETURN>, where /Volumes/Scratch is the destination for the new file. (Don’t worry if you don’t understand this command right now; you can read Chapter 15 for some help. The important thing here is to realize that I had to access Scratch via the path /Volumes/Scratch.)

Note

If you’re using OS X 10.3.0 through 10.3.2, the issue mentioned in the previous two items applies here, as well. Any volume that has been mounted by browsing the Network item in the Finder isn’t accessible in Terminal via / Volumes. Rather, you access it via the path /var/automount/Network/volumename (or possibly /var/ automount/Network/Local/volumename). Again, this issue is fixed in OS X 10.3.3 and later.

Tip

In Mac OS X 10.3 and later, OS X automatically creates a symbolic link (similar to an alias) in /Volumes that points to the boot volume; this means that you can access any volume via /Volumes/volumename, not just non- boot volumes.

Tip

You can also access non-boot volumes using any of the tips I showed you in Chapters 5 and 6.

Copying versus Moving with Multiple Volumes

User Level | any
Affects | individual user
Terminal | no

To many users this will be old hat, but users whom I consider to be quite competent have asked me about this, so it’s definitely not obvious. When you drag an item (file, folder, application, etc.) from one place to another on the same volume, it will be moved (provided you haven’t held down any modifier keys as explained in Chapter 5). However, when you drag an item from one volume to another volume, it will be copied. In other words, it will still exist on the first volume, but a copy of it will be made on the second.

If you want to move an item from one volume to another, hold down the command key as you drag it between volumes. This will copy the file to the new volume and delete it from the original volume simultaneously.

Permissions on Non-Boot Volumes

I mentioned this earlier in the book, but it’s worth mentioning again here. The default permissions for non-boot volumes are Read & Write for Owner and “Read only” for Group and Others. In addition, the “Ignore ownership on this volume” option in the Get Info window for the volume (described below) is enabled. In other words, everyone has full access.

If you disable the “Ignore ownership on this volume” option in the volume’s Get Info window without changing any other settings, that volume will behave just like the Shared user folder—everyone will be able to view the contents of the volume and will have access to those contents based on each file’s own permissions. (Items copied to such a non-boot volume will retain their original permissions, and you can always change the permissions on a particular document or folder on that volume to restrict access.)

In addition, an administrative user can change the permissions for the entire volume. Here are a couple ways to do so.

Creating a “Private” Volume

User Level | admin
Affects | computer
Terminal | no

Consider the example I used in Chapter 1 where parents could create a group called Adults and then set the permissions for those items they wanted to keep private from their children to Group: Adults with Read & Write Access and Others: No Access. You can use a similar procedure to make an entire volume—a second hard drive, a CD-RW or DVD-R, or even a mounted disk image—private.

  1. Select the mounted volume in the Finder (from the Desktop, a Finder window showing the Computer view, or a Finder sidebar).

  2. Choose File Ø Get Info (or press command+I).

  3. Click the triangle next to Ownership & Permissions to expand that panel; click the Details dis- closure triangle to view all permissions settings.

  4. For the Group setting, choose the appropriate group name, and give it Read & Write access.

  5. For the Others setting, choose No Access.

  6. Make sure “Ignore ownership on this volume” is not checked.

  7. To ensure that any items already on the volume are also inaccessible to those not in your group, click the “Apply to enclosed items… button.

Users not in your group will not even be able to view the top-level contents of the volume, but those in the group will have full access.

Tip

If you want a personal private volume—one that no user but you can access—follow the instructions above but set the Group name to “nogroup” or “nobody.” These groups have no users in them, so no one but you will have access to files on the volume. (You can also set Group Access to No Access, but technically this doesn’t offer you any extra protection.)

Creating a “Universal Access” Volume

User Level | admin
Affects | computer
Terminal | no

At the opposite end of the security spectrum from a private volume, you can set up a volume so that all users can access and modify all files. I call this a “universal access” volume, but some people call it a “shared” volume. (I don’t like calling it a shared volume because OS X already has a Shared user folder, and that folder has different permissions than what I’m discussing here.) These types of volumes are often used to share files and folders than multiple users need to edit.

To do this, simply follow Steps 1–3 above, but instead of using Steps 4–7 to set groups and permissions, check the box next to “Ignore ownership on this volume.” This setting does just what its name implies—it tells OS X to disregard ownership and permissions for any and all files on the volume, allowing unfettered access by any user. So make sure you only use such a volume for files that you’re sure you want anyone to be able to modify. Just to be safe, you may want to make backup copies of important files before moving them to the universal access volume (since anyone could delete files at will).

Permissions on Removable Volumes

For the most part, permissions on removable volumes (FireWire hard drives, floppy disks, magneto- optical drives) work as described in the previous section (“Permissions on Non-Boot Volumes”), provided you use that volume on the same computer that formatted it and/or first applied file ownership and permissions to it. However, any other Mac will always treat the volume as if the “Ignore ownership on this volume” box is checked in the volume’s Ownership & Permissions info panel.

The reason for this is that Unix—and thus OS X—keeps track of users and groups via user IDs and group IDs; since every OS X computer uses the same ID system, there’s no way for OS X to know if user ID 501 on one computer is the same person as user ID 501 on another. Thus, whenever you mount a removable volume on a computer other than the one used to format it, the “Ignore ownership on this volume” box will automatically be set.

Sharing a Non-Boot Volume

User Level | admin
Affects | computer
Terminal | no

As I discussed in Chapter 10, by default OS X shares only users’ home directories (to their respective users) and users’ Public folders (to all users). However, as I discussed in Chapter 10, you can manually create additional shares using tools such as SharePoints. You can use the same technique to share entire non-boot volumes (or just directories on a non-boot volume).

For example, as mentioned earlier in this appendix, my desktop Mac has an extra hard drive that holds all of the MP3s I’ve ripped from my CD collection—about 40GB worth. Rather than copy all 40GB of files to my PowerBook’s hard drive, I’ve set up the iTunes volume as a Personal File Sharing share and then configured the PowerBook so that all accounts mount the iTunes volume at login. Anyone using iTunes on the PowerBook can listen to all 40GB of music even though it’s located on the desktop Mac.

Tip

You can also combine this tip with the previous two to create private shares or universal shares that are accessible remotely.

Changing the Startup Volume

User Level | admin
Affects | computer
Terminal | no

If you have OS X installed on multiple volumes, or if you have a mix of OS 9 and OS X installations on multiple volumes, you’ll need to switch startup disks when you want to boot from another disk. I mention this topic here because it’s a logical place for it, but I’m going to refer you to Chapter 3, where I’ve already covered the topic under “Choosing a Startup Volume or System.”

Installing OS X on FireWire Volumes

User Level | admin
Affects | computer
Terminal | possibly

You can install OS X on additional volumes by using the OS X Installer disc(s) or by copying an existing OS X installation using Carbon Copy Cloner, as I covered in Chapter 4. However, if you install or copy OS X to an external FireWire drive, you may initially have difficulty booting off of that drive. A possible solution is to make sure the FireWire drive is mounted and then type the following command in Terminal: sudo bless -folder /Volumes/volumename/System/Library/ CoreServices <RETURN>, where volumename is the name of the FireWire drive. This command blesses the volume, which means it forces OS X to see it as a legitimate startup volume. You should then be able to select it as a startup volume.

Unmounting/Ejecting Removable Volumes

If you mount a removable volume—a CD, a FireWire drive, etc.—and no other users are logged in, then you can usually unmount that volume by dragging it to the Trash/Eject icon in the Dock (or by clicking the Eject button in Finder sidebars, by selecting it and clicking the Eject item in the tool- bar, etc.). However, if another user mounts a removable volume, or if you mount it and then other users log in concurrently via Fast User Switching, the situation may get a bit more complicated. For example, network volumes (volumes to which you are connecting over a local network or the Internet) can only be unmounted by the user who mounted them. Or you may find that trying to unmount a volume visible to other users brings up the Finder’s authentication dialog, meaning that only an admin user can unmount that volume. (Note that under OS X 10.3 and later, logging out of your account may also unmount a removable volume, as explained in the next section.)

I use the phrase may get a bit more complicated here because Apple has tweaked this behavior slightly through several updates to Mac OS X, so although the above paragraph is accurate at the time of this writing, I’m not confident that it will always be!

FireWire Drives and OS X 10.3 (Panther)

User Level | admin
Affects | computer
Terminal | yes

Under versions of OS X prior to 10.3, once a FireWire drive is mounted it remains mounted until a user manually unmounts it or until the Mac is shut down. However, Mac OS X 10.3 and later treat FireWire drives a bit differently. When a FireWire drive is connected to your Mac, it’s only mounted—meaning it’s only available for use by applications and the operating system—when a user is logged in. If you’re the only user currently logged in, when you log out, the FireWire drive is unmounted. When you log back in, the FireWire drive is mounted again. (If Fast User Switching is enabled, the drive is mounted as long as any user is logged in; once the final user logs out, the drive is unmounted.)

The reasons for this change are twofold. First, it makes it easier to disconnect FireWire drives when you’re already logged out—instead of having to log in, unmount a drive, and then disconnect it, you can simply disconnect it (since you know it’s already unmounted). The second reason is to support an alleged future Mac OS X feature that allows you to place your user directory (your home folder) on a removable volume.

However, the consequence of this new behavior is that files on removable FireWire volumes are unavailable unless a user is logged in. For example, in my home, I have several FireWire drives connected to my G5. When I’m away from home, I often connect to the G5 from my PowerBook over the Internet via Personal File Sharing. But if no one is logged into the G5, the FireWire drives aren’t available via Personal File Sharing—because they aren’t mounted! Needless to say, this can be a significant inconvenience.

If you need FireWire drives to be available all the time, one possible solution is to create an “extra” user and then log into that account when you log out of your own (or, even easier, just leave that account logged in all the time via Fast User Switching). However, another solution that’s a bit more “permanent” is to actually change OS X’s behavior so that it treats FireWire drives in OS X 10.3 and later like OS X 10.2 and earlier. To do this, open Terminal and type the following command (all on one line):

sudo defaults write
Ä/Library/Preferences/SystemConfiguration/autodiskmount
ÄAutomountDisksWithoutUserLogin -bool true <RETURN>

Provide your admin username and password when prompted. Then restart your Mac. From this point on, FireWire drives will mount as soon as they’re connected (regardless of whether or not a user is logged in) and remain mounted until you shut down.

If you ever need to revert to the default OS X 10.3 behavior, open Terminal and type the following command (all on one line):

sudo defaults delete
Ä/Library/Preferences/SystemConfiguration/autodiskmount
ÄAutomountDisksWithoutUserLogin <RETURN>


Using Drive Partitions

I briefly mentioned hard drive partitions earlier in this appendix, but I want to talk more about them here. You may already have your drive(s) partitioned, but if you don’t, this section should help you decide whether or not partitioning is for you. I’ll also show you how to partition using OS X’s builtin tools.

If you’re not familiar with the procedure, partitioning is a way of taking a hard drive (or other type of storage device) and dividing it up into sections (partitions) that appear to the operating system as separate volumes. For example, you can divide a 120GB drive into three partitions of 65GB, 35GB, and 20GB, and those partitions will show up in OS X as three different hard drives (on the Desktop, in Finder windows, in Terminal, etc.). You can generally partition a drive into as many segments as you want, and the partitions don’t have to be of equal size.

Note

In technical terms, hard drives are often called physical volumes (because they’re physically a single storage device) whereas partitions of a hard drive are called logical volumes (because they appear to the OS as separate volumes).

Benefits of Partitioning

There are, speaking generally, five benefits of partitioning. The first is that since each partition acts like a separate drive, you can install a different operating system (OS 9, OS X, Linux, etc.) on each one and then easily choose which OS to boot into (at startup using the Startup Manager, or from Startup Disk preferences). You can even install different copies or version of OS X on different partitions. If you read the previous appendix, you’ll remember that I recommend this approach if you find yourself booting into both OS 9 and OS X, and switching between the two frequently.

The second reason why partitioning can be useful has to do with disk fragmentation. I mentioned fragmentation and optimization in Chapter 14, but it’s basically the process through which files are stored in pieces across your hard drive instead of in contiguous segments. In theory, the more fragmented your drive, the slower its performance. (I say in theory because although this was very true in Mac OS 9 and earlier, it’s a hotly debated topic under OS X. Some people claim the slowdown is significant, others say it’s undetectable. I’m somewhere in the middle. In fact, in OS X 10.3 and later, some degree of automatic defragmentation actually occurs.) Some of the worst contributors to hard drive fragmentation are Web browsers—which store hundreds or even thousands of cache files on your hard drive to speed up browsing—and frequent downloads and deletions. To avoid this, what some users do is create a small secondary partition and relocate their browser caches, Internet down- loads, and any other files that are frequently saved and deleted to this partition. This way these files don’t contribute to fragmentation of your “main” volume.

Another argument for drive partitions, related to the previous one, is that many applications require large amounts of temporary disk space for working with files. For example, Adobe Photoshop requires scratch space on your hard drive to perform many of its functions. If you designate your main hard drive as the scratch disk, chances are Photoshop’s scratch files are going to be strewn out across your drive, which can slow Photoshop’s performance (as well as contributing to fragmentation of that volume). Another example is editing digital video; when you import video from a camcorder, the video data—which is significant in size—gets saved wherever there’s space on your hard drive. If you save video to your boot volume, it’s going to be split up into many small pieces across the drive. When you later go to work with that video, performance can suffer as your video editing application has to search for each piece. Thus it follows that if you create a dedicated partition to be used only for Photoshop scratch files, or only for digital video storage, those files are more likely to be saved in large contiguous chunks, which may increase performance (and also won’t contribute to the fragmentation of your boot volume). Again, as with the previous paragraph, I should mention that because OS X handles disk fragmentation much better than OS 9 and earlier, this isn’t quite the issue it used to be. However, some people still swear by it.

Another argument for partitioning is that if you do a lot of CD burning, you may want to consider creating a partition that you use exclusively for storing data to be burned. Because burning CDs requires immediate (and uninterrupted) access to the data to be copied, fragmented data can lead to unsuccessful CD burns. A dedicated CD “scratch” partition (mine is actually called CD Scratch, appropriately enough) gives you a contiguous block of drive space that you can use to store files for burning. After you burn the data to CD, you can then erase the partition to ensure that it’s clean and unfragmented for the next CD. As a bonus, by making it the same size as a blank CD (640MB or 695MB), you know exactly when you’re out of space—when the volume is full.

Finally, another reason to consider partitioning is for easier backups. Some users like to store documents, and even their entire user directory, on a smaller, non-boot partition. Backing up is then a matter of simply backing up that partition, rather than their entire OS X volume. (If you’re interested, I’ll show you how to move your user folder to a non-boot partition later in this appendix under “Moving a User Folder—or All User Folders—to a Non-Boot Volume.”) In some situations, having all of your documents on a single partition can also improve performance since all document access is confined to a single area of the hard drive, rather than spread out across the entire drive.

Note

If you’re not comfortable with partitioning (see the next section, “Drawbacks of Partitioning”), you can get pretty much the same benefits by simply installing a new hard drive (for a desktop Mac) or by connecting an external hard drive (for any Mac). In fact, in most cases the benefits will actually be greater since your Mac can read data from and write data to two drives at once. Prices have gone down so much that you can get an 120GB (or bigger!) hard drive for under $100 if you look hard enough.

Drawbacks of Partitioning

None of the benefits I described above may appeal to you; if so, great—you don’t have to worry about how to go about partitioning a drive. However, if you do find partitioning tempting, keep in mind that there are also a few drawbacks.

The first, and most severe, drawback is that partitioning a drive usually requires you to first back up all the data on the drive, then erase the drive completely, then set up partitions, and then restore your data back to one or more of the partitions—it’s not a simple procedure by any means. In fact, the best time to partition a drive is when you first get it (when you bring a new drive home from the store, or when you first get your Mac)—that’s really the only time that erasing the drive has no real drawbacks. If the drive is brand new, if it’s empty, or if you’re just getting a new Mac, all of the software on the hard drive can be restored fairly painlessly using the Software Restore disc(s) that come with the Mac.

The second drawback is that once you decide on your partition sizes, you’re pretty much stuck with them unless you want to really get into nasty (and risky) partition resizing exercises in Terminal. So if you later realize that you made your boot partition too small, or you want to change the size of a non-boot partition, your only real recourse is to—yes—back everything up, erase the drive and set up new partitions, and then restore your data. So you really need to make sure that you set up your partitions well in the beginning.

Note

When I say that you can’t partition (or re-partition) without backing up and then reformatting your hard drive, I’m not being entirely honest. There are ways to do it using Terminal, but you risk data loss if you don’t know exactly what you’re doing. In addition, if you can boot your Mac into OS 9, FWB’s Partition Toolkit (http://www.fwb.com/) allows you to resize, create, and delete partitions without reformatting. However, at the time of this writing, there’s no OS X version of Partition Toolkit, so if you have one of the newer Macs that can’t boot into OS 9, you can’t use it.

Third, partitioning a drive into several volumes can actually decrease performance due to the fact that the average seek time (the time it takes to move the hard drive’s read/write heads from one position on the drive platters to another) is increased. For example, if you have a single volume, your system software, applications, documents, swap files, scratch files, etc. are all stored in a fairly localized group of hard drive blocks—OS X generally tries to store data as close to the beginning of the volume as is reasonable. However, if you partition a drive and split your data between partitions, you’re forcing your drive’s heads to move back and forth across unused drive space (the space between the end of data on one partition and the beginning of data on the next) as they retrieve and save data. The more your drive has to access data on different partitions, the longer the average seek time is going to be.

Finally, another drawback is that all of the issues I discussed earlier in this appendix (in the section “Working with Multiple Volumes in OS X”) will apply to you and your partitions. Some of these issues are actually benefits, but a few are inconvenient at best.

Partitioning a Drive in OS X

User Level | admin
Affects | computer
Terminal | no

If after considering the pros and cons of partitions you decide it’s something you want to do, here’s how to do it using OS X’s Disk Utility. Note that you can’t boot from the volume you’re about to partition while you partition it (since you’re going to erase it during the process). If you have another boot volume (an additional hard drive, a FireWire drive, etc.), you can boot from that volume and then access Disk Utility in /Applications/Utilities. If you don’t have another boot volume, you can boot from the OS X Install CD and access Disk Utility from the first screen (from the Installer menu).

Warning

As I mentioned above, to partition a drive you have to erase it, so make sure you’ve backed up any important data before starting this process! (And make sure it’s backed up to a different drive or media, not just to somewhere else on the drive being partitioned.)

  1. Double-check to make sure you’ve backed up any important data on the drive you’re going to partition.

  2. Triple-check.

  3. In Disk Utility, select the drive you want to partition from the list of volumes on the left. (You must select the drive itself, not any existing partitions on that drive.)

  4. Click the Partition tab. You’ll see a graphical representation of the disk (the Volume Scheme display); if this is a new drive, it will contain one large partition (and possibly a very small partition called free or something similar). If you click any part of the volume display, the Volume Information display will give you information about that partition’s name, size, and format.

    Note

    If you’re using OS X 10.2 or earlier, you actually click the Partition tab in Disk Utility first and then select the drive you want to partition from the list on the left.

  5. From the Volume Scheme pop-up menu, choose the number of partitions into which you want to divide the drive. The volume display will automatically divide into the number of partitions you’ve chosen, all of equal sizes. (If you decide you want more partitions, you can select a partition and click the Split button; conversely, you can reduce the number of partitions by selecting one and clicking the Delete button.)

  6. Resize each partition to the desired size. You can do this by clicking in a partition and then typing a size in the Size field in Volume Information, or by grabbing the resize tab at the bottom of a partition in the volume display and dragging it up or down.

    Note

    The Size field in the Volume Information box uses either MB or GB as the unit of size; it changes automatically to allow you to fine-tune the volume being resized.

  7. Configure the volume information for each partition by clicking a partition, typing a name for it, and then choosing a drive format from the Format pop-up menu. For almost everyone, I recommend Mac OS Extended or Mac OS Extended (Journaled)—see Chapter 14 for more details on the latter. Mac OS Standard can only be used by OS 9 and earlier, and Unix File System (also known as UFS) isn’t fully compatible with OS X (see http://docs.info.apple.com/article.html?artnum=25316 for more details). Free Space has special significance that most users will never use. (If you need to format a volume as Free Space, you probably understand it and know why you need it.)

  8. If your Mac can boot into Mac OS 9, you’ll see an additional option called “Install Mac OS 9 Disk Drivers.” If you ever plan to use this disk to boot into Mac OS 9, check this box. (The drive will work fine in the Classic environment in OS X, and will still be usable on a computer running OS 9, regardless of your choice here; however, if this box is not checked, you won’t be able to boot into OS 9 from that drive.)

  9. Are you absolutely sure there’s no data on this disk that you need but haven’t backed up? (Sorry, I just want to make sure.)

  10. Click the Partition button to partition the disk. You’ll see a warning dialog reminding you how serious this procedure is (Figure B.1). If you’re sure, click Partition.

The disk will be divided into separate logical partitions, each of which behaves like a separate hard drive. In Figure B.2, you can see five volumes mounted on my PowerBook, which was running OS X 10.2 at the time this screenshot was taken); these are actually two hard drives divided into five partitions.

Figure A.1: Disk Utility warns you that partitioning erases any volumes on the disk being partitioned—this erasure cannot be undone.
Click To expand
Figure A.2: An example of partitions: two physical drives partitioned into five volumes


Customizing OS X When Using Multiple Volumes

Besides the obvious uses for multiple volumes—storing files and alternate operating systems—there are a few other things you can do. In the sections that follow I’ll show you how to move a user folder (or all user directories) to a non-boot volume and how to move your system swap files to a non-boot volume.

Moving a User Folder—or All User Folders—to a Non-Boot Volume

User Level | admin
Affects | individual user or all users
Terminal | no

Although it’s common in large network environments for user directories to be stored somewhere besides the local computer (e.g., on a central server), most home users have never even considered such a setup. Nevertheless, there are a few situations where you might want to consider it. For example, you can keep your user folder(s) on a separate volume from the rest of your OS X files in order to make backing up your user folder(s) easier. Or perhaps you test a lot of software—you can keep your user folder(s) on a non-boot volume, and if your OS X installation becomes unstable, you can reformat the drive and reinstall OS X, keeping your user folder(s) intact. (After you reinstall, you’ll have to again reassign your home directories to their location on the alternative volume using the procedure described below.) Or maybe you have multiple OS X startup volumes—you can use a single user folder for all of them. Whatever the case, if you want to move your user folder(s) to another volume, the next two sections will show you how.

Warning

At the time of this writing, you should not move user folders to a removable volume unless that volume is always connected. The reason for this is that OS X doesn’t properly handle the situation where a volume that contains user folders isn’t connected and mounted when a user tries to log in. If you try to log in to an account that resides on a removable volume, and that volume isn’t mounted at the time, you’ll not only be unable to access the account then, but you’ll never be able to access it again in the future without first using Terminal to delete a bunch of invisible files (a procedure too messy to get into here). I emphasize at the time of this writing here because there’s evidence that Apple may fully implement this feature in a future update to Mac OS X.

Warning

If you have FileVault enabled for your account, you should not attempt to move your user folder to another volume until you’ve disabled FileVault. Similarly, if you or any other users have FileVault enabled, you should not attempt to move all user directories to another volume until FileVault is disabled for all users. Doing so could result in a loss of data.

Moving a Single User Folder to a Non-Boot Volume

User Level | admin
Affects | individual or multiple users
Terminal | yes

Although it’s possible to move a user directory to a different volume using a combination of Terminal and NetInfo Manager, it’s easier, and quicker, to do the whole shebang using Terminal:

  1. Type sudo ditto -rsrc /Users/username ’/Volumes/volumename/Users/username’ <RETURN>, where username is the short name of the user whose folder you want to move and volumename is the name of the volume to which you want to move it; provide your admin password when prompted. The ditto command copies the user folder (including any hidden files); the -rsrc option ensures that all resource forks are copied.

  2. Type sudo niutil -createprop / /users/username home ’/Volumes/volumename/Users/ username’ <RETURN>. This command uses the niutil command to reassign your home directory from the original location to the new location. In fact, if you were to use NetInfo Manager to make this change, you’d actually be changing the home property for the user username to /Volumes/volumename/Users/username.

  3. If you moved your own account, log out and then back in, and make sure your user folder was copied and reassigned properly; otherwise have the user whose folder you moved log in and check. To check, open a Finder window and click the Home button in the toolbar or sidebar (or choose Go Ø Home or press shift+command+H); make sure that the path to the folder is /Volumes/volumename/Users/username. (You can also open a new Terminal window and type pwd <RETURN>; the path to your home directory will be displayed in Terminal.)

  4. Assuming everything is working properly, launch Terminal and type sudo rm -dr /Users/ username/ <RETURN>; provide your admin password when prompted. This command deletes your original user folder.

  5. Type sudo ln -s ’/Volumes/volumename/Users/username’ /Users/username <RETURN>. This command creates a symbolic link (similar to an alias) from the Users folder on the boot volume to your new user folder on volumename. This step isn’t absolutely necessary, but it makes it easier to access the moved user folder since the link to the folder will show up in the standard Users directory on the boot volume.

Tip

The only application that seems to have a problem with your user folder being moved to a different volume is Microsoft Excel. If this bug affects you, locate the file called Carbon Registration Database from the ~/Library/Preferences/ Microsoft folder of any original user folder (i.e., a user folder that is still located in /Users). Copy this file to the same folder in any new user folder (i.e., a user folder on the non-boot volume). This should allow Excel to run.

Moving All User Folders to a Non-Boot Volume

User Level | admin
Affects all | users
Terminal | yes

If you want to move all user folders to another volume, the commands are similar, but not identical:

  1. Type sudo ditto -rsrc /Users ’/Volumes/volumename/Users’ <RETURN>, where volumename is the name of the volume to which you want to move the user folders; provide your admin password when prompted.

  2. For each user, type sudo niutil -createprop / /users/username home ’/Volumes/ volumename/Users/username’ <RETURN>. (In other words, you’ll need to type this command once for each user.)

  3. Log out and then back in to make sure the user folders were copied and reassigned properly.

  4. Assuming everything is working properly, launch Terminal and, for each user folder except the Shared user folder, type sudo rm -dr /Users/username/ <RETURN>; provide your admin password when prompted. (Again, you’ll have to use this command once for each user.)

  5. For each user (again, except for the Shared user folder), type sudo ln -s ’/Volumes/ volumename/Users/username’ /Users/username <RETURN> to create a link from the Users folder on the boot volume to your new user folder on volumename.

Note

Note that if you create a new user(s) after completing this procedure, you’ll need to perform Steps 2–5 for each new user.

Note

The reason you need to delete each user folder, and then link to each, separately, leaving /Users/Shared as-is, is that some applications require you to have the Shared folder inside the Users folder on the boot volume.

Using a Non-Boot Volume for System Swap Files

User Level | admin
Affects all | computer
Terminal | no

As mentioned earlier, one advantage of OS X is its superior memory management. Part of this memory system is the ability to use sections of the boot drive as virtual memory—hard drive space that stores less-recently-used contents of your computer’s actual RAM in order to make room for data currently being used. (For the curious, this process is called paging.) When the data stored on the hard drive is needed, it’s quickly moved back into real RAM. This memory trickery allows your computer to function as if it has far more memory than it actually does.

These sections of the hard drive used for temporary RAM offloading are called swap files because the OS swaps data to and from them frequently. Although this process is very efficient, it has a few drawbacks. First, these swap files take up hard drive space that you may want to use for “real” files. Second, swap files themselves can contribute to drive fragmentation (discussed in Chapter 14). The less free space you have on your boot volume, the more significant each of these two drawbacks becomes. Finally, swap files slow drive access down a bit since your hard drive has to switch between accessing “normal” data and accessing swap files.

Note

To get around these drawbacks, some users prefer to use a different volume altogether—one dedicated to the task— for swap files. By telling OS X to use a different volume for swap files, you don’t have to worry about taking hard drive space away from other files, fragmenting your swap files, or contributing to fragmentation of your boot volume. In addition, if swap files reside on an entirely different hard drive, virtual memory performance can actually increase, since the “swap file” drive can work independently from the system/data drive. Locating your swap files on a different partition of the same hard drive used as the boot volume will gain you benefits in terms of fragmentation but will most likely result in a slight decrease in overall drive performance—the drive heads will still have to alternate between accessing swap files and other files but will have to travel further to do so (increased average seek time, as described earlier in the chapter).

If you have an extra hard drive or drive partition, and you’d like to try this procedure, the easiest way is to use the shareware Xupport (http://www.computer-support.ch/Xupport/). Xupport is an excellent, all-around utility that provides a nice interface to many Unix commands—I recommend it even if you don’t intend to change your swap file location. Here’s how to use it to move your swap files:

  1. Launch Xupport, and click the Swap button in the Xupport toolbar.

  2. From the “Swap file location” pop-up menu, choose the volume you want OS X to use for virtual memory swap files.

  3. After you choose a volume, you’ll see a dialog that tells you to “Press the Set button AND restart your computer.” Click OK, and then click the Set button.

  4. You’ll get a second dialog to verify that you want to change the swap file location to the chosen volume. Click Continue, and then enter your admin password when prompted.

  5. Restart your Mac.

Once you restart, your Mac will store its swap files on the chosen volume. To verify this, open a new Finder window and choose Go Ø Go to Folder… (or press shift+command+G); type /Volumes/ volumename/vm in the "Go to the folder" field (where volumename is the name of the volume you chose for your swap files), and then click Go. This will take you to the folder on that volume where the virtual memory swap files are stored. You should see a file named swapfile0; if you do, the procedure was successful.

Warning

As with moving user directories, do not move your system swap files to a removable volume, as you’re asking for trouble. If you remove the volume while the system is running, or if the volume isn’t present when the computer boots, your computer won’t have its swap space available, which is a bad thing. (OS X should automatically relocate its swap file storage to the boot volume, but I’ve heard reports that this doesn’t always happen properly.)


Index

Note to the Reader: Throughout this index boldfaced page numbers indicate primary discussions of a topic.

Italicized page numbers indicate illustrations.

A

Access Control tab, 527
accounts. See user accounts
Accounts pane for user accounts
creating, 23–27, 24, 26
deleting, 27–28
login process, 120–125
passwords, 59
root logins, 42
user levels, 9
Acrobat Reader, 294–295
Action item, 209
activation items in Expose, 278
Active Applications box, 343
Active Network Ports, 360
Active Screen Corners, 277
Activity Monitor utility
Force Quit from, 322
for processes, 136, 136
working with, 302–304, 304
add-ons, 152–156, 154–155
adding
add-ons, 152–156, 154–155
printers, 462–466, 472–473, 472
administrative actions, automating, 557–559, 558
administrative shares, 437
administrators and Admin users, 9, 27
limiting access to, 504
permissions with, 45
security for, 506
sharing with, 392, 433
Advanced Add Printer dialog, 484
Advanced tab, 342–343
AFP (Apple File Protocol), 399, 427
AFS Properties tab, 404
AirPort Home location, 364
AirPort Travel location, 364
AirPort utilities, 304–305, 360, 364, 377
alerts
for faxes, 498, 498
sounds for, 92
Alfred program, 154–155, 155
alias command, 592
aliases
for files and folders, 235
in Finder, 225
for PDF files, 491
in sharing, 441–442
in Unix, 592
AliasMenu program, 269
AliasMultiplier X program, 237
All Off location, 364
all windows mode in Expose, 274, 275
Allow user to administer this computer option, 25
Allow user to log in from Windows option, 28
allowed packets, 508
alternate server ports, 425
Always open folders in a new window option, 199
Always show file extensions option, 192
analog command, 609
Animate opening applications option, 253
animating Desktop, 78–79
anonymous FTP access, 409
Answer after # rings setting, 497
anti-aliased text, 68
AntiVirus program, 539
.app extension, 146
appearance
Classic Environment, 348–349, 349
preferences for, 67–69, 69
toolbars, 64
Appearance pane, 67–69
Apple File Protocol (AFP), 399, 427
Apple menu
in Classic Environment, 351
clearing, 68
Force Quit from, 321, 321
for preference pane access, 64
Apple Remote Desktop (ARD), 458
AppleCare channel, 299
AppleScripts
for PDF files, 491
on toolbars and sidebars, 216
AppleTalk protocol
for Personal File Sharing, 403
for printers, 463–464
application switchers in Dock, 264–265
application windows mode in Expose, 274, 275, 279
applications, 273. See also utilities
accessing. See Expose
appearance of, 39–40
Backup, 285
Calculator, 285–286
Chess, 286
in Classic Environment, 349–350, 349, 354–355
Clock, 287
on Dock, 258, 261
DVD Player, 287–288, 287
Font Book, 289
groups of, 236–237
help for, 283–284
hiding, 258, 273–274
Image Capture, 289–293, 290–291
installation location for, 144
kinds of, 282
Mac Slides Publisher, 292
menus for, 284
minimizing, 273–274
moving, 147–148
for PDF files, 491
permissions for, 6
preferences for, 103–104, 284
Preview, 292–295, 293
priorities for, 561–562, 562
QuickTime Player, 295–296
quitting, 34–35, 452
root account for, 37–40
Script Editor, 296
Sherlock, 296–299, 297
Stickies, 299–300
text, 323–328, 325–327
TextEdit, 300–302, 302
title bars for, 282–283
toolbars for, 104–105, 105, 282
troubleshooting, 320–322, 321
for Unix, 598–599
in updates, 169
Watson, 297–299, 297
Applications folders
files in, 147
in home folders, 8
Applications item
in System Profiler, 319
on toolbars and sidebars, 210, 216
Apply to enclosed items option, 45
apropos tool, 604
Aqua toolbar, 104
Archive and Install option, 167–168, 167
ARD (Apple Remote Desktop), 458
arguments in Unix, 581–583
arrow keys
in Expose, 279
in shell, 581
associations for files, 190–191, 191
asterisks (*) in Unix, 584–585
attachments, 539
attributes
for files, 195–197
for Keychain items, 526
for TextEdit documents, 301
Attributes tab, 526
AtYourService program, 327
authentication dialogs, 14
auto-completion in Unix, 583–584
autodiskmount command, 614
autolist variable, 590
automatic operations
administrative actions, 557–559, 558
DVD playing, 288
logins, 23, 140, 504–505
logouts, 521
share connections at logins, 445–446
Automatically hide and show the Dock option, 253
Automatically log in as setting, 120


Index_B

Team LiB

Index

B

back slashes (\) in Unix, 582–583
background applications, 574
backgrounds
Finder windows, 224
login screen, 129
BackJack service, 568
backquotes (`) in Unix, 595–596
Backup application, 285
backups
basics of, 564
FileVault, 536
frequency of, 565–566
local and removable, 566–567
media for, 567–568
NetInfo database, 18–19
network settings, 366–367
preference files, 108
selection criteria for, 564–565
strategies for, 568–569
utilities for, 569–571, 570
bars (|) for Unix pipes, 594
bash shell, 580
BatChmod utility, 53
battery power, 84, 364
BBEdit editor, 577, 593, 604
for preference files, 106
for printing folder listings, 227
beeps, visual, 93
Bergstrand, Brian, 73
beta software, 11
Bind All Similar Items option, 191
bless command, 619
Blob utility, 280
blocks on drives, 542
Bluetooth File Exchange utility, 371, 393, 394
Bluetooth pane, 81, 86–87
Bluetooth protocol
for sharing files, 392–394, 394
System Preferences for, 370–371
Bluetooth Setup Assistant, 305
Bombich, Mike, 179
Bookit program, 383–384, 384
bookmarks
DVD Player, 288
networking, 381–385, 382–384
Boot Config utility, 134–135, 135
boot process, 111–112
boot pane in, 111, 117–119, 118
boot volume choices in, 114–117, 114
safe boots, 139
startup volume and system choices in, 113–117, 113
boot strings, 117
bootable CDs, 312, 551
BootCD application, 312, 551
BootROM activation, 111–112
bootstrap daemons, 132
BootX utility, 112, 118
BrickHouse utility, 513–516, 514
broken Keychains, 531–532, 532
Browse Shared Cameras and Scanners dialog, 291
Browseable option, 417
browsers
bookmarks for, 381–385, 382–384
for FTP, 438
iCeCoffEE, 378
pop-up ads in, 385–386
popular, 379–380, 380
for printing folder listings, 227
searching with, 378–379, 380
window size in, 385–386
browsing
with Bluetooth, 393
vs. Connect To Server, 435
Open/Save dialogs, 245–246, 246
BSN init process, 112
Bucanek, James, 573
buffers in Terminal, 575
built-in firewalls, 511–516, 512
Bumps screen saver, 76
.bundle extension, 146
bundles, 145
Burn item on toolbar, 209
burning CDs
images, 307
partitions for, 621
Burnz utility, 313


Index_C

Team LiB

Index

C

cache file, 67
caches
cleaning, 555–556
for deleted files, 548
Calculator application, 285–286
Calindock application, 266
Camera tab, 290
Camino browser, 379, 380
CandyBar program, 210
Captain FTP client, 439
Carbon applications, 282
Carbon Copy Cloner program, 179–182, 180, 571
Carbon Registration Database, 626
Carbonized applications, 104, 334
cd command, 450, 582
CDs
for backups, 567
bootable, 312, 551
booting from, 115
burning disk images to, 307
ejecting, 141
erasing, 308–309
multiple-session, 311–312
partitions for, 621
for restoring software, 163–164
CDs & DVDs pane, 81
ChangeDesktop program, 73
changing. See also editing
color table, 98–99
file extensions, 191–192
permissions, 44–45, 44, 52–53, 53
short usernames, 53–58
startup volumes, 618
toolbars display, 104
volume change sound, 92–93
channels in Sherlock, 296–299, 297
Character Palette, 79–80, 80, 318
CharView utility, 318
Chess game, 286
chgrp command, 45
chmod command, 45
Chooser utility, 478
chown command, 45
ChronoSync program, 571
classes, printer, 469, 474
Classic applications, 276, 281–282
Classic Control Menu program, 341
Classic Environment, 333–334
appearance of, 348–349, 349
Apple menu in, 351
application launching in, 349–350, 349, 354–355
cautions for, 336–337
with Fast User Switching, 33–34
memory for, 345, 347, 351
partitions for, 345
permissions in, 354–355
preference files for, 350
printing in, 352, 477–478
running status of, 348
starting and stopping, 352
startup files for, 344–347, 353
support and limitations on, 335–336
System Folder for, 344–347, 345, 354
System Preferences for, 95, 337–344, 338, 343
technical details of, 334–335
troubleshooting, 353–355
updating software for, 337
Classic pane
Advanced tab, 342–343
Memory/Versions tab, 343–344, 343
Start/Stop tab, 338–341, 338
Classic Spy program, 341, 348
Classic Toggler program, 348, 352
cleaning
caches, 555–556
drives, 178, 553–555, 554
Finder windows, 224
text, 331
cleanup scripts, 553–555, 554
clearing Apple menu, 68
Click in the scroll bar setting, 67
clipboards, multiple, 328, 329
clipEdit program, 330
clippings for text, 330
Clock application, 267, 287
cloning for backups, 569, 571
Cocoa applications, 282, 323–328, 325–327
Collections list, 71–73, 72
color
DigitalColor Meter for, 306–307
file labels, 195–196
Color tab, 82
color table, 98–99
ColorSync utility, 305
Column view in Finder, 221–223, 221, 223
command-line programs, 574
command substitution, 595–596
commands
paths for, 591
in Unix, 581–582, 595–596
command+S keys, 138–139
Commands tab, 97
command+V keys, 139
Comments pane, 195
Common Unix Printing System. See CUPS (Common Unix
Printing System)
compatibility
with Classic Environment, 334
with Fast User Switching, 33–34
compiling Unix programs, 609–610
complete variable, 590
Completed Jobs screen, 476
compressed disk images, 310
compressing files, 398, 409–410
Computer item
on sidebars, 215
on toolbar, 210
computers, transferring operating system between, 180–183
Configure Toolbar dialog, 210
Conflict Catcher utility, 131, 341, 344–345, 345, 353
Connect item on toolbar, 210
Connect To iDisk dialog, 430, 430
Connect To iDisk Public Folder dialog, 429, 429
Connect to Server dialog, 427–428, 435
connecting
to printers, 460
to QuickTime, 94
with Remote Login, 449
to shares. See shares and sharing
to Virtual Private Networks, 372–373, 446–447, 447
connection logs, 373
Connection tab, 94
console.log file, 306
console logins, 140–141
Console utility, 305–306
content
for Dock, 259–261
finding files by, 242–244, 243
Content index pane, 193–194, 242–243, 243
Contents folder, 146, 146
contextual menus, 269
add-ons for, 152–153
for files, 228–230, 228
control-clicking, 228
Control Panels folder, 346
control statements, 597
conversions
in Calculator, 286
disk images, 311
graphics, 292
copying
files, 231
with multiple volumes, 616
network preferences, 366–367
text, 323
CopyPaste-X program, 328–329
CopyPath program, 230
CosmoSaver screen saver, 76
cp command, 19, 450, 582
CpMac command, 607
crash log files, 306
crashes in Classic Environment, 353–354
cron program, 557–559, 560, 604
CronniX program, 558–561, 558, 560
crontabs, 557
CUPS (Common Unix Printing System), 461–462, 471
for adding printers, 472–473, 472
for configuring printers, 473
for deleting printers, 474
for printer classes, 474
for queue management, 474–476, 475
curl command, 608–609
Customize item on toolbar, 209
Customize Toolbar dialog, 208, 208
CyberDuck FTP client, 439


Index_D

Team LiB

Index

D

daemons
listen, 563
in Unix, 574
daily script, 554
Dantz backup system, 151
Darwin environment, 573–574
dashes (-) in Unix, 581, 585
Data Backup X program, 569
Data Recycler program, 547–548
Data Rescue X program, 547
data risks with Fast User Switching, 33
date, international options for, 79
Date & Time tab, 95–97, 96
DAVE program, 418, 437
dedicated FTP/SFTP clients, 438–440
Deep Cleaning option, 556
Default Folder X program, 249, 250
defaults
firewall rules, 515
Keychains, 528
permissions, 43–44, 44
shells, 411
voice, 97
defragmenting drives, 548–551, 549–550
DejaVu program, 569–570, 570
delays, keyboard, 99
Delete item on toolbar, 210
Deleted Users folder, 29–30
deleting
Dock items, 259
groups, 50–51
Keychain items, 528
Keychains, 530
print jobs, 468
printer drivers, 478–479
printers, 467, 474
services, 327–328
shares, 403
software, 175
toolbar items, 105
user accounts, 29–30, 29
variables, 586
deletions
security for, 537–538
undeleting, 547–548
DeLocalizer program, 174, 175
denied packets, 508
DesInstaller program, 176, 177
Desktop, 201
accessing, 204–205, 205–206, 246–247. See also Expose
animating, 78–79
folder for, 7
as home folder, 235–236
location of, 201–202
printers, 485–487
View Options for, 202–203, 202
virtual network computing for, 454–458, 455, 457
Desktop & Screen Saver pane, 69–70
Desktop tab, 70–71
for permanent folders, 71–73, 72
Screen Saver tab, 73–78
Desktop Effects, 78
Desktop folders, 8
Desktop mode in Expose, 276, 276, 280–281, 281
Desktop tab, 70–71
/DEV directory, 596
developer support files in updates, 169
Developer Tools
for file visibility, 197
uninstalling, 174–175
Device Options tab, 289
Device screen, 472
Device URI screen, 471
Devices tab, 371
DEVONthink program, 325–326, 326
df command, 607
Diablotin pane, 132–134, 133
diagnosing drives, 551–552
dialogs, authentication, 14
Dictionary channel, 299
digital cameras, Image Capture for, 289–293, 290–291
DigitalColor Meter utility, 306–307
direct technologies, 370
directories
drive, repairing and rebuilding, 542–545
in URLs, 425
Directory Access utility, 307, 416
Directory Services, 466
Disable Apple Menu logout option, 124
Disable ">console" login feature option, 124
disabling
FileVault, 536
Guest access, 400–401
Open Firmware password protection, 519
port configurations, 360–361, 362
Public folders, 402
root account, 41, 506
services, 134, 135
SSH, 411–412, 412
user accounts, 30–31
user logins, 125, 504–505
Disc Burner utility, 307
DiscBlaze utility, 313
Discribe utility, 313
Disk Copy utility, 308
for disk images, 149
for encryption, 533
Disk Doctor program, 552
disk drives. See drives
disk images
burning to CDs and DVDs, 310–313
creating and converting, 308
DropDMG for, 312
for encryption, 533–534
Internet-enabled, 149
mounting, 150
Disk Utility
areas in, 308–310, 309
for directory problems, 543–544
for disk images, 310–313
for encryption, 533–534
for partitions, 623–624, 624
for permissions, 46, 46
for zeroing data, 538
DiskImageMounter application, 308
diskutil tool, 608
DiskWarrior program, 544–545
display in Terminal, 575
Display Login Window as setting, 120–121
Displays pane, 82–83
distribution, software, 148–150
ditto command, 607, 626–627
.dmg files, 149
DNSUpdate service, 408
DocJector application, 266
Dock, 251
accessing, 257
alternatives to
keyboard launchers, 270–271, 270
menus, 268–269, 269
replacements, 271–272, 271
application switchers in, 264–265
applications on, 258, 261
for Classic Environment, 352
content for, 259–261
Desktop access from, 204–205, 205
Docklings in, 65, 265–267, 266
for favorites, 382, 382
Finder for, 260
Force Quit from, 321–322
keyboard-enhanced actions in, 263
location files with, 444–445, 445
menus for, 257–258, 258, 267
multiple, 267
for preference pane access, 65–66
settings for, 251
Dock pane, 252–253, 252
hidden, 254
skins, 256, 256
TransparentDock, 254–256, 255
storage on, 261–262, 262
Dock Detox program, 253
Dock-It program, 271
Dock pane, 252–253, 252
Dock Setup tab, 255–256, 255
Dock Size option, 252
DockDisks pane, 261
DockExtender program, 267
DockFun! program, 267
DockIP program, 408
DockLess program, 261
Docklings, 65, 265–267, 266
DocklingWrapper program, 266
DockSwap program, 267
document windows, 282
Documents folder
accessing, 246–247
in home folders, 8
Documents item on toolbars and sidebars, 210, 215
dollar signs ($) in Unix, 586
domain levels, 12–15, 13–14
domain names, 423
Download Only feature, 160
Download Options tab, 289
Download Some screen, 289–290, 290
downloading updates, 160–161
drag and drop folders, 247–248
drag and drop in Expose, 279–280
drag-and-drop installation, 152
dragging title bars, 282
Dragster program, 556
DragStrip program, 271
DragThing program, 271, 271
Drive 10 program
for defragmenting drives, 549–550
for directory repair, 544
for optimizing drives, 550
for testing drives, 552
drivers, printer, 153, 460–461, 478–482
drives, 541–542
for backups, 567
cache cleaning, 555–556
cleaning, 178, 553–555, 554
defragmenting, 548–551, 549–550
diagnosing, 551–552
directory problems on, 542–545
free space reports for, 559–560, 560
journaling, 545–546
optimizing, 550–551
partitions for. See partitions
permission repairs for, 553, 560–561
recovering files on, 547
recovery services for, 552–553
saving space on, 557
transferring operating system between, 179–180, 180
undeleting data on, 547–548
in Unix, 608
DriveSavers recovery service, 553
DropDMG program, 312
DropPrint program, 486–487
DropStuff utility, 398
DropZip utility, 398
du command, 607
dumb terminals, 575
DVD Capture program, 288
DVD Player application, 287–288, 287
DVDs
for backups, 567
booting from, 115
burning disk images to, 310–313
ejecting, 141
dynamic IP addresses, 408


Index_E

Team LiB

Index

E

e-mail
attachments in, 539
for URLs, 386
E-mail tab, 368
EasyFind program, 244
echo command, 582
editing. See also changing
CUPS options, 476–477
firewall filters, 515–516
groups, 50–51
keyboard shortcuts, 91
Keychain items, 527
preference files, 106–109, 107
printers, 473
startup scripts, 593
Terminal text, 576
user accounts, 27–28
user templates, 9
editors, Unix, 604
EightBall application, 266
EINS Server setting, 416
Eject item
on sidebar, 213
on toolbar, 209
ejecting
CDs and DVDs, 141
removable volumes, 619
Email To option, 497–498
enabling root account, 40–41
encoding files, 409–410
encryption, 506, 533–537, 534
Energy Saver pane, 83–84, 84
Engst, Adam, 568
environment variables, 588–589
equal signs (=) in Unix, 586
Erase area in Disk Utility, 308–309
erasing CDs, 308–309
escape characters in Unix, 582–583
ESP Ghostscript package, 480
etc folder, 171
Ethernet DHCP Travel location, 364
Euphoria screen saver, 76
exchanging data. See shares and sharing
executable scripts, 597
ExecutiveSync program, 571
exit command, 139
expanding variables, 586
Expose, 274–276
advanced tips and tricks, 279–280
floater in, 280–281, 281
for hiding Desktop items, 204
preferences for, 277–278, 277
extensions, file, 189–192, 191
extensions, kernel, 131
in boot process, 112
in updates, 172
Extensions folder, 346–347
Extensions Manager, 131, 341, 344


Index_F

Team LiB

Index

F

Fast User Switching, 31–32, 31, 122
for screen locking, 523
security for, 32–33
warnings for, 33–35
favorites
files and folders, 237–238
location files as, 445
for networking, 381–385, 382–384
servers, 427
on toolbar, 210
Favorites folder, 237–238, 260
Favorites item on toolbars and sidebars, 216
Fax Alert Installer, 498, 498
Fax dialog, 494–495, 495
Fax List window, 496
faxes, 493
Page Sender for, 499
preferences for, 494
receiving, 496–499, 497–498
sending, 494–496, 495
Faxes folder, 8
.FBCIndex file, 243
Fetch FTP client, 439
File Buddy utility
for group permissions, 53
for invisible bit, 196
for restoring files, 168
for volume changes, 92–93
File Exchange tab, 371, 393
File Monitor program, 498
File Sharing Only users, 401–402, 402, 414
File Sharing protocol, 397
File Visibility screen, 416–417
filenames
in Finder, 225
viewing, 248
files, 189
aliases for, 235
attributes for, 195–197
compressing, 398, 409–410
contextual menus for, 228–230, 228
copying, 231
in Dock, 260
encrypting, 533–537, 534
favorites, 237–238
Finder for. See Finder
finding, 238–244, 239–240, 242–243
Get Info window for, 192–195, 194
groups of, 236–237
indexing, 242–244, 243
labels for, 195–196
moving, 222, 231–232, 451
Open and Save dialogs for, 245–249, 246, 250
Open With for, 233
paths for, 248–249
permissions for, 5
recovering, 547
redirecting, 594–596
sharing. See shares and sharing
temporary storage for, 233
types and extensions for, 189–192, 191
in Unix, 596–597, 607–608
in URLs, 425
and user accounts, 7, 7
FileVault feature, 534–537, 534
FileXaminer utility
for group permissions, 53
for invisible bit, 196
filters, firewall, 515–516
find and replace for text, 324–325
find command, 585–586
Find function for files, 239–241, 240
Find item on toolbar, 210
Finder
background windows in, 224
cleaning windows, 224
Desktop access from, 204
for Dock items, 260
for favorites, 382
filenames in, 225
folder listings in, 226–227
FTP in, 441
hiding, 204
for non-boot volume access, 614–615
preferences for, 103, 197–201, 198, 213
scrolling in, 225, 227
sidebars in, 212–215, 212, 214
status bars in, 225–226
Title Bar icon in, 225
toolbars in, 206–211, 207–208, 211
undo feature in, 244
view options for, 103, 201, 216–223, 218–221, 223
finding
files, 238–244, 239–240, 242–243
PDF text, 293, 293
startup items, 127
Unix files, 585–586
finger command, 608
Fink Commander interface, 599
Fink program, 598–599
Fireflies screen saver, 76
Firefox browser, 379
Firewalk X firewall, 516
Firewall tab, 511–512, 512
firewalls, 507–508
built-in, 511–516, 512
configuring, 513–516, 514
hardware routers as, 508–511
rules for, 513, 515
third-party, 516–517
FireWire
for installation, 618–620
working with, 366
First Aid tab, 308, 543
Flexible Space item on toolbar, 209
floater, Expose, 280–281, 281
Fluid screen saver, 76
folders, 12
aliases for, 235
in Collections list, 71–73, 72
domain levels in, 12–15, 13–14
encrypting, 533–537, 534
favorites, 237–238
going to, 234
groups of, 236–237
home, 7, 7
contents of, 8–9
Desktop as, 235–236
listing, 226–227
for PDF files, 491
permissions for, 6
sharing. See shares and sharing
spring-loaded, 200, 232
sticking settings for, 224
and user accounts, 7, 7
Font Book application, 289
fonts
location of, 153
smoothing, 68–69
Fonts palette, 323–324
force booting, 116
Force Quit window, 348
force quits, 196, 320–322, 321, 348
formats for location files, 443–444
Formats tab, 79
forms, PDF, 295
fragmentation, drive, 548–551, 549–550, 621
.framework extension, 146
free space reports for drives, 559–560, 560
freezes, troubleshooting, 320–322, 321
FruitMenu utility
for contextual menus, 230, 269
for preference pane access, 64
fsck utility, 20, 139, 543–544, 546, 608
FTP
server connections, 437–441, 439–440
for sharing, 405, 408–410
ftp command, 609
FTPeel FTP client, 439
Fugu FTP/SFTP client, 439
Full Keyboard Access feature, 87
Funkeys utility, 90
FWSucker application, 520


Index_G

Team LiB

Index

G

Galaxy screen saver, 76
General pane, 193
General Properties screen, 416
Genie Effect, 253
Get Info item on toolbar, 210
Get Info window, 192–195, 194
GIDs (group IDs), 49, 51
Gimp-Print program
for drivers, 480–482
for unsupported hardware, 183
global keyboard shortcuts, 88
globbing, 584–585
Go to Folder dialog, 234
going
to folders, 234
to Keychain items, 528
Goliath client, 428
Grab utility, 313–315
Graphic Converter, 129
graphics
in TextEdit documents, 300–301
viewer for, 292
greater than signs (>) signs for redirection, 594
grep command, 607–608
group IDs (GIDs), 49, 51
groups
creating, 49–51, 50–51
of files, folders, and applications, 236–237
permissions for, 47–53, 53
GROUPS variable, 589
guest users
in Personal File Sharing, 400–401
user accounts for, 11


Index_H

Team LiB

Index

H

Hackpose utility, 280
hard drives. See drives
hardware
preferences
Bluetooth pane, 81, 86–87
CDs & DVDs pane, 81
Displays pane, 82–83
Energy Saver pane, 83–84, 84
Ink pane, 85
Keyboard pane, 85–86
Keyboard Shortcuts pane, 87–91, 89
Mouse pane, 86
Print & Fax pane, 91
Sound pane, 91–93
unsupported, 183–184
hardware abstraction layer, 335
Hardware item in System Profiler, 319
hardware routers as firewalls, 508–511
hdiutil tool, 608
Hearing tab, 93, 99
help
for applications, 283–284
for Unix, 604–606
Help Center, 284
Help Viewer, 283–284
.hidden file, 197
hidden Internet preferences, 369
hidden settings
Dock, 254
Internet, 369, 369
hidden startup scripts, 593
Hide admin users in the list of users to select from option, 123
Hide Files option, 416
Hide Files Starting with a Period option, 417
Hide local users in the list of users to select from option, 123
Hide the Sleep option, 122
hiding
applications, 126, 258, 273–274
Desktop items, 203–204
files, 196–197
status bars, 225–226
user accounts, 124–125
HimmelBar program, 269
hints for passwords, 17, 24, 121
holding print jobs, 468
Home Directories screen, 417
home folders, 7, 7
contents of, 8–9
Desktop as, 235–236
Home item on toolbars and sidebars, 210, 215
Home Page feature, 397
home pages, local files as, 384–385
Homemade Dot-Mac with OS X article, 386
HOST variable, 589
Hot Corners configuration, 74, 74
Hot Corners tab, 522
HotAlias utility, 237
hyphens (-) in Unix, 581, 585


Index_I

Team LiB

Index

I

IANA (Internet Assigned Numbers Authority), 374
iApps, 284
iBeeZz program, 83
IC-Switch, 369
iCab browser, 379, 385
iCeCoffEE browser, 378
iChat program, 34
iChoose program, 445, 445
Icon view in Finder, 217–219, 218
iDisk Storage tool, 316
iDisk tab, 367–368
iDisk Utility, 316
connecting to, 428–432, 429–430
for Internet, 367–368
remote sharing with, 394–397, 396
on toolbar, 210
iDiskMenu utility, 430
ifconfig command, 608
iListen program, 330
Image Capture application, 289–293, 290–291
images
for boot pane, 117–119, 118
disk. See disk images
Images dialog, 25
inactive updates, 159
Include network users in the list of users to select from option, 123
indexing files, 242–244, 243
Info window, 4, 5
Information area in Disk Utility, 308
Ink feature, 85, 330–331
input in Unix, 594–596
Input Menu tab, 79–80, 80
Input tab, 91
Installable Options pane, 466
installation, 143
file location in, 143–145
Fink program, 598
on FireWire volumes, 618–620
Gimp-Print package, 480–481
moving installed applications, 147–148
packages for, 145–146, 146
screen savers, 75
services, 327
software. See software installation
Unix programs, 609–610
installation logs, 177–178
Installed Updates tab, 159
Installer utility, 150, 316
and packages, 150–152, 151
for system add-ons, 154
Intego NetBarrier firewall, 516
Intego VirusBarrier program, 539
interactive programs, 574
Interarchy FTP/SFTP client, 438
internal addresses, 374, 424
international options, 78
Formats tabs, 79
Input Menu tab, 79–80, 80
Language tab, 79
Internet
location files for, 381, 442–445, 443, 445
plug-ins for, 153
sharing printers over, 484
System Preferences for, 367–369, 369
Windows file sharing over, 418
Internet & Network Preferences category, 93–95
Internet Assigned Numbers Authority (IANA), 374
Internet Connect application, 371–373, 373
Internet-enabled disk images, 149
Internet Explorer browser, 385
Internet routers, 375–377, 406–407
Internet Sharing feature, 373, 373, 375–377
Internet tab, 376
Internet tools for Unix, 608–609
invisibility
of files, 196–197
in security, 524
invisible bit, 196–197
InVisibles utility, 197
IP addresses, 406–408, 423–424
IP over FireWire, 366
ipfw program, 511, 513
iPhoto pictures, 70–71
IPMenu program, 408
IPSec protocol, 446
iSeek utility, 378–379
iSleep program, 288
iTerm program, 577
Ittec program, 230
iTunes, 34, 258, 258


Index_J

Team LiB

Index

J

Jaguar
Disk Copy utility, 308
Internet preferences, 368
login items, 128
password hints, 121
passwords accounts, 28
saved updates, 162
shells, 580
system preferences, 70
user accounts, 28
utilities, 303
journaling, 545–546


Index_K

Team LiB

Index

K

Keep arranged by option, 203
kernel extensions, 131
in boot process, 112
in updates, 172
Key Caps utility, 316–318, 317
Key Xing utility, 270
keyboard
access options for, 99
for Dock, 263
enhancements for, 90
Expose settings for, 277–278
for launching applications, 270–271, 270
layouts for, 80
for navigating, 248
on-screen, 99, 100
for screenshots, 313–314
shortcuts, 87–91, 89, 323
volume keys for, 92
Keyboard Maestro program
for clipboards, 328–329
for hotkeys, 270
Keyboard pane, 85–86
Keyboard tab, 99
Keyboard Shortcuts tab, 87–91, 89
Keyboard Viewer utility, 316–318, 317
Keychain Access utility, 318, 523, 528
Keychain First Aid utility, 531–532, 532
Keychain menu extra, 522–523
Keychains, 442, 524
access in, 525–531, 526
alternatives to, 532
Keychain-aware applications, 524–525, 526
for locking screen, 522–523
repairing, 531–532, 532
KeyStrokes function, 99, 100
kinds of applications, 282


Index_L

Team LiB

Index

L

L2TP (Layer 2 Tunneling Protocol), 446
labels for files, 195–196
Labels X program, 196
language support, uninstalling, 174
Language tab, 79
Languages for searching files contents option, 201
Languages pane, 194–195
LaunchBar utility, 270–271, 270
launching applications
in Classic Environment, 349–350, 349, 354–355
with keyboard, 270–271, 270
Layer 2 Tunneling Protocol (L2TP), 446
left side of Dock, 259
less than signs (<) signs for redirection, 594
LESS variable, 590
levels
domain, 12–15, 13–14
in user accounts, 9–10, 10, 27
Library folder
in home folders, 8
in updates, 169–170
Light Cleaning option, 556
Limitations tab, 25–26, 26
LinuxPrinting.org site, 479
List view in Finder, 219–220, 219–220
listen daemons, 563
Listening tab, 97
lists of users, 123–125
LiteSwitch X program, 265
LittleSecrets program, 532
ln command, 626–627
local backups, 566–567
local copies of iDisks, 430–432
local domains, 13
local IP addresses, 424
local variables, 588–589
locate function for files, 241–242, 242
location files
for Internet, 442–445, 443, 445
for networking, 381
Location X program, 364–366, 365
Locator program, 241
Lock after x minutes of inactivity setting, 529
Lock when sleeping option, 529
locking
Keychains, 528
screen, 522–523
logical volumes, 620
Login Items Engine, 128
Login Items pane, 128
Login/Logout Hooks option, 124
Login Options tab, 42
login screen
background, 129
text banner in, 129–130
Login Window Manager, 122–124, 123
logins, 119–120
Accounts panel for, 120–125
disabling, 125, 504–505
Fast User Switching for, 31–35
logging out, 130
login screen, 129–130
preferences for, 122–125, 123
as root, 42
safe, 139–140
server connections at, 445–446
services for, 131–135, 133, 135
sharing options for, 434, 445–446
Startup Items pane for, 126–128, 126
Terminal access at, 140–141
LogMaster program, 563, 563
logos, login screen, 130
LogOut screen saver, 521
logouts, auto, 521
logs
of completed print jobs, 476
for firewalls, 516
for FTP, 410
in Internet Connect, 373
for Personal File Sharing, 403
reviewing, 563, 563
in System Profiler, 319
for uninstalling packages, 177–178
long filenames
in Finder, 225
viewing, 248
lookup command, 608
lost data, recovering, 547
LPR printers, adding, 464
ls command, 450, 581–582
lsof command, 607


Index_M

Team LiB

Index

M

.Mac account, 75
Mac Glossary, 283
Mac OS X Colors dialog, 218–219
.Mac pane, 94, 367–369, 369
Mac Slides Publisher application, 292
.Mac tab, 367
Macaroni program, 555
mach files, restoring, 168–169
mach.sym files, restoring, 168–169
MacJanitor program, 554–555, 554
MacPAD update service, 161
macro viruses, 539
MacUpdate program, 230
magnetic tape for backups, 567
magneto-optical disks for backups, 567
Magnification setting for Dock, 252–253
Mail package, 146, 146
Mail Toolbar, 104, 105
man command, 604–606
Manage Printers screen, 473
manual operations
software deletions, 175
updates, 161–162
mapping ports, 407, 509–511, 509
Marine Aquarium screen saver, 76
master passwords
for FileVault, 535–536
hints for, 122
Max Connections setting, 416
MaxiMice utility, 90
#MaxJobs option, 476
MaxMenus program
Desktop access from, 205, 206
as Dock alternative, 268–269, 269
media for backups, 567–568
Media Keys tab, 94
memory
for Classic Environment, 345, 347, 351
with Fast User Switching, 33
monitoring, 304, 304
Memory pane, 194
Memory/Versions tab, 343–344, 343
menu bar for preference pane access, 64, 65
.menu extension, 146
Menu Extra Enabler program, 341
Menu Master utility, 90
Menuprefs utility, 64, 65
menus
for applications, 284
contextual, 152–153, 228–230, 228, 269
for Dock, 257–258, 258, 267
location files with, 444–445, 445
in URL Manager Pro, 382–383
utilities for, 268–269, 269
minimizing
applications, 273–274
windows, 261–262, 262
Mirror Displays option, 82
mkdir command, 450
Model/Driver screen, 472
Modem Travel location, 364
modems with Fast User Switching, 33
modifiers for keyboard shortcuts, 89
Modify Printer procedure, 472
Monitor window, 516
monitoring
firewalls, 516
processes, 136, 136, 302–304, 304
Monolingual program, 174
monthly script, 554
Moose's Apprentice utility, 409
More Internet pane, 369, 369
mounted volumes in Dock, 261
mounting
disk images, 150
shares and volumes, 426
mouse
enhancements for, 90
Expose settings for, 278
Mouse Keys functionality, 99–100
Mouse pane, 86
Mouse tab, 99
Movies folder, 8
Movies item on toolbars and sidebars, 210, 215
moving
files, 222, 231–232, 451
installed applications, 147–148
with multiple volumes, 616, 625–627
preference files, 108–109
print jobs, 468–469
MOX Optimize utility, 134
Mozilla browser, 379, 385
multi-channel sound, 288
multihoming, 362
multimedia files, 295
multiple clipboards, 328, 329
multiple Docks, 267
multiple files, opening, 247
multiple folders, rotating photos from, 73
Multiple Launcher X program, 237
multiple-session CDs, 311–312
multiple volumes, 613–614
copying vs. moving with, 616
FireWire, 618–620
moving with, 625–627
non-boot, 614–616
permissions on, 616–618
for sharing, 391, 618
startup, 618
system swap files on, 627–628
Music folder, 8
Music item on toolbar, 210
Music tab for QuickTime, 94
mv command, 20–21, 450, 582
MvMac command, 607


Index_N

Team LiB

Index

N

Name & Extension pane, 193
Name & Location pane, 466
Name field, 24
names
aliases for, 592
keyboard shortcuts, 89
for user accounts, 24
NAT (Network Address Translation), 375, 507–508
natd program, 514
navigating
keyboard for, 248
Open and Save dialogs, 245–249, 246
NetBarrier firewall, 516
NetBoot images, booting from, 116
NetInfo database, 15–16
backing up, 18–19
rebuilding, 21–23
restoring, 19–21
working with, 16–17, 18
NetInfo Manager application, 17–18, 18
for creating groups, 49–50, 50
for disabling accounts, 30
for enabling root account, 40
for printers, 462
for SFTP, 411, 412
Netscape browser, 379
NetService program, 327
netstat command, 608
Network Address Translation (NAT), 375, 507–508
Network domain, 15
Network File System (NFS), 419, 441
Network item in System Profiler, 319
Network pane, 94
Network Port Configurations dialog, 360, 362, 377
network time servers, 95–96
network tools for Unix, 608–609
Network Utility, 318
networks and networking, 359–360. See also Internet
for backups, 567
bookmarks for, 381–385, 382–384
browsers for. See browsers
location files for, 381
pop-up ads in, 385–386
servers for, 386
sharing in. See shares and sharing
System Preferences for, 94, 360
Bluetooth, 370–371
copying and backing up, 366–367
network locations, 363–366, 365
port configurations, 360–361, 362
port priorities, 362–363
New Finder Window shows option, 199
New Folder item on toolbar, 210
NeXTStep operating system, 573–574
NFS (Network File System), 419, 441
NFS Manager program, 419
niutil command, 626–627
nmap command, 609
No Access permission, 5–6
No Limits mode, 25
no-password user accounts, 58–59, 59
non-boot volumes
accessing, 614–616
moving folders to, 625–627
permissions on, 616–617
sharing, 618
system swap files on, 627–628
non-PostScript printers, 459–460
nonstandard characters, entering, 316–318, 317
Normal users, 9, 27, 45, 433
Norton AntiVirus program, 539
Norton Personal Firewall, 516
Norton Privacy Control, 516
Norton Utilities program
for defragmenting drives, 549
for directory problems, 544
for file recovery, 547
for optimizing drives, 551
for testing drives, 552
for undeleting data, 547–548
null device, 596
Number of Recent Items setting, 68
numbers, international options for, 79


Index_O

Team LiB

Index

O

Old Glory screen saver, 77
OLDPWD variable, 589
OmniWeb browser, 379, 385
on-screen keyboards, 99, 100
online backups, 567
Open and Save dialogs
Default Folder X for, 249, 250
navigating, 245–249, 246
for non-boot volume access, 615
on sidebars, 215
open command, 582, 604–605
Open Directory feature, 466
Open Firmware
for password protection, 518–520
purpose of, 141–142
Open iDisk tool, 316
Open new windows in Column View option, 199–200
Open Public Folder tool, 316, 396, 429
open source software, CUPS, 479
Open Subfolder X program, 230
Open Terminal utility, 216
Open Terminal Here utility, 216
Open With, 193, 233
opening
groups of files, folders, and applications, 236–237
System Preferences, 66–67
OpenMenu program, 230
Opera browser, 379
operating system
installation files location for, 143–144
transferring between computers and drives, 178–183, 180
uninstalling files for, 174
updating and reinstalling, 166–173, 167
Optimize Energy Settings menu, 84
optimizing drives, 550–551
options in Unix, 581–582
Options pane and screen
for clean installs, 167
for energy savers, 83–84
in Image Capture, 289
for print job settings, 488
OS X Package Manager, 165
osascript command, 605
OSXvnc server, 454, 458
Others category, 100–102, 101–102
output in Unix, 594–596
Output tab, 91
Ownership & Permissions section, 4, 5


Index_P

Team LiB

Index

P

Pacifist utility, 165–166, 166, 174
packages, 145–146, 146
installer, 150–152, 151
uninstalling, 176, 177
Page Sender feature, 499
paging process, 627
paired technologies, 370
panes, 61
accessing, 63–67
security for, 66
Panther
FireWire drives, 619–620
Internet preferences, 368
password hints, 121
passwords, 28
saved updates, 162
shells, 580
startup items, 128
system preferences, 70
user accounts, 28
utilities, 303
Panther Cache Cleaner (PCC), 556
parallel folders, 15
Partition area in Disk Utility, 310
Partition Toolkit program, 622
partitions, 620
benefits of, 621–622
for Classic Environment, 345
creating, 623–624, 624–625
drawbacks of, 622–623
parts of software, installing, 164–166, 166
Password Assistant, 529, 529
Password Hint (optional) field, 24
Password Retriever program, 532
passwords
authentication dialogs for, 14
for FileVault, 535–536
forgotten, 122
in FTP, 409
hints for, 24, 121
for Keychain items, 527
for Keychains, 529–530
for logins, 120–123
no-password user accounts, 58–59, 59
Open Firmware for, 518–520
for panes, 66
Panther vs. Jaguar, 28
for root user, 40–42
in security, 504–505
single-user mode, 520–521
for user accounts, 24–25
pasteboard windows, 328
pasting text, 323
Path property, 127
PATH variable, 591–592
paths
for files, 248–249
on toolbar, 209
in Unix, 591–592
PCC (Panther Cache Cleaner), 556
PCI Extreme program for unsupported hardware, 184
PCL (Printer Control Language), 460
PDF (Portable Document Format) files, 293–295
printing to, 488–491
for screenshots, 314
working with, 490–491, 490
Pepper, Chris, 573
performance with FileVault, 536
peripherals, unsupported, 183–184
permanent folders in Collections list, 71–73, 72
permissions, 3–5, 5
changing, 44–45, 44, 52–53, 53
in Classic Environment, 354–355
default, 43–44, 44
for groups, 47–53, 53
meanings of, 5–6
on multiple volumes, 616–618
for printing, 499–500
repairing, 553, 560–561
troubleshooting, 46–47, 46
Personal File Sharing, 397–399, 509, 511
access in, 399, 404–405
configuring, 399–405, 400, 402
connecting to, 432–435, 432, 434
Personal Firewall, 516
personal preferences category, 67–69, 69
Appearance pane, 67–69
Desktop pane, 69–78
Dock pane, 78
Personal Web Sharing, 419–421, 420
photo slide shows, 75
Photoshop program, 621
physical volumes, 620
pico editor, 604
pictures
Image Capture for, 289–293, 290–291
login, 25
Pictures folder, 8
Pictures Folder module, 75, 77
Pictures item on toolbars and sidebars, 210, 215
ping command, 608
pipes in Unix, 594–595
piPop utility, 269
.pkg extension, 146
Plasma Tunnel screen saver, 77
plist file, 67, 72
Plug-ins pane, 195
Plus Optimizer program
for defragmenting drives, 549
for optimizing drives, 550
Point-to-Point Protocol over Ethernet (PPPoE), 371
Point to Point Tunneling Protocol (PPTP), 446
poof actions, 255
pools, printing, 469–470
pop-up ad blocking, 385–386
Pop-Up Zapper utility, 385
PopChar X utility, 318
port blocking, 407
Portable Document Format (PDF) files, 293–295
printing to, 488–491
for screenshots, 314
working with, 490–491, 490
porting Unix programs, 610–611
ports
alternate server, 425
configurations for, enabling and disabling, 360–361, 362
for Internet connections, 407–408
mapping, 407, 509–511, 509
priorities for, 362–363
for services, 510
in sharing, 406–408
in URLs, 425
Position on screen setting, 253
Postfix Enabler article, 386
PostScript files, 492
PostScript Printer Description (PPD) files, 460–461
PostScript printers, 459–460
PPD add-ons, 153
PPP tab, 372
PPPoE (Point-to-Point Protocol over Ethernet), 371
PPTP (Point to Point Tunneling Protocol), 446
PrefEdit utility, 106–107, 107
preference files, 105
backing up, 108
editing, 106–109, 107
location of, 106
moving, 108–109
System Preferences for. See System Preferences
troubleshooting, 108–109, 322
preference pane add-ons, 153
Prefling application, 266
.prefPane packages, 101
Preserve Users and Network Settings option, 167, 167
#PreserveJobFiles option, 476
#PreserveJobHistory option, 476
Preview application, 129, 292–295, 293
preview column in Finder, 221, 221
Preview pane, 194, 194
Previous Systems folder, 168
Print & Fax pane, 91
for faxes, 494, 497, 497
for printing, 470–471
Print Center utility, 463
functions in, 486
for printing folder listings, 226
Print on printer option, 498
Print Window program, 227
PrintDocuments CM plug-in, 487
Printer Control Language (PCL), 460
Printer Info window, 466
Printer List window, 463, 463
Printer Model pane, 466
Printer Setup Repair program, 500
Printer Setup utility
for adding printers, 462–466
for configuring printers, 466
customizing, 470
for deleting printers, 467
for queue management, 467–469, 468
printers and printing, 459
adding, 462–466, 472–473, 472
classes for, 474
in Classic Environment, 352, 477–478
configuring, 466, 473
connections for, 460
deleting, 467, 474
Desktop, 485–487
drivers for, 153, 460–461, 478–482
faxes, 493–499
folder listings, 226–227
to PDF files, 488–491
permissions for, 499–500
pooling, 469–470
to PostScript files, 492
PPDs for, 460–461
preferences for, 470–471
Quartz Filter for, 487
queue management for, 467–469, 468, 474–476, 475
saving settings for, 487–488
selective, 493
sharing, 465, 482–485
troubleshooting, 499–500
types of, 459–460
in Unix, 609
unsupported, 479–480
PrintMagic utility, 493
priorities
for applications, 561–562, 562
for network configurations, 362–363
for ports, 362–363
private volumes, 616–617
Process Viewer utility, 112, 136
processes
Active Monitor for, 302–304, 304
stopping and restarting, 135–138, 136
processor usage with Fast User Switching, 33
ProcessWizard utility, 562, 562
profiles for optimizing drives, 551
programs. See applications; utilities
Property List Editor tool, 71–72, 106
protocols in URLs, 424–425
proxy icons for applications, 282–283
PS1 variable, 589
Pseudo utility, 37–38, 38
PTHPasteboard program, 328, 329
Public Folder Access tool, 316
Public folders, 390–391
connecting to, 428–429
in home folders, 8
in Personal File Sharing, 402
Public item on toolbars and sidebars, 210, 215
Put Classic to sleep when it is inactive for option, 342
pwd command, 450, 582


Index_Q

Team LiB

Index

Q

Quartz Extreme technology
for Desktop pictures, 71
for screen savers, 74
Quartz Filters, 487, 489–490
QuartzDisplay.Bundle package, 117
question marks (?)
in Dock, 260
in Unix, 584
queues
configuring, 466
CUPS for, 474–476, 475
fax, 496
Printer Setup for, 467–469, 468
QuickAccessCM program, 269
QuickBom script, 146
QuicKeys utility, 270
QuickTime pane, 94
QuickTime Player application, 92, 295–296
Quit option on Dock, 258
quitting applications, 34–35, 452
quotes (' ") in Unix, 582–583


Index_R

Team LiB

Index

R

RAID area in Disk Utility, 310
RAM
for Classic Environment, 345, 347, 351
with Fast User Switching, 33
monitoring, 304, 304
random device, 596–597
RBrowser FTP/SFTP client, 438
Read & Write permission, 5–6
Read Only option, 417
Read only permission, 5–6
ReadMe files, 152, 156
realname property, 16–17
Rebuild Desktop option, 342–343
rebuilding
drive directories, 542–545
NetInfo database, 21–23
receiving faxes, 496–499, 497–498
recent servers, 427, 445
recovering
files, 547
forgotten passwords, 519–520
recovery services, 552–553
redirection in Unix, 594–596
regular expressions, 607–608
reinstalling
operating system, 166–173, 167
printer drivers, 461
rejecting print jobs, 475
remote access and control, 447–448
Remote Login, 448–454
user accounts for, 12
VNC, 454–458, 455, 457
Remote Login, 448
connecting with, 449
quitting applications with, 452
for software updates, 452–453
SSH for, 434
working with, 450–454
remote sharing
with FTP, 405, 408–410
with iDisk, 394–397, 396
with Personal File Sharing. See Personal File Sharing
with Personal Web Sharing, 419–421, 420
with SFTP, 410–412, 412
with SMB, 413–417, 417
removable backups, 566–567
removable volumes
permissions on, 618
unmounting and ejecting, 619
Rendezvous names, 471, 483
Rendezvous technology
benefits of, 374
FTP client support for, 440
operation of, 374
for printing, 463–464, 482–483
warnings for, 375
renice command, 561–562
Renicer utility, 562
Repair Disk function, 543
Repair Disk Permissions utility, 560–561
repairing
drive directories, 542–545
Keychains, 531–532, 532
permissions, 553, 560–561
replacing Unix programs, 591–592
reset passwords, 41
resize dialogs, 247
resource forks, 398, 409
Restart option, 122
restarting
after software installation, 151–152
startup processes, 135–138, 136
Restore area in Disk Utility, 310
restoring
boot panel images, 119
keyboard shortcuts, 91
NetInfo database, 19–21
software, 163–166, 166
RetroRun item, 151
Retrospect utility, 151, 569
ReViewPkg utility, 165
right side of Dock, 259
Riley, Nicholas, 378
risks with Fast User Switching, 33
rm command, 450, 582, 626–627
rmdir command, 450
root account, 10, 35–36
access to, 10, 36, 37
disabling, 41, 506
enabling, 40–41
logging in as, 42
passwords for, 40–42
for running applications, 37–40, 37–38
sharing with, 392
for short usernames, 56–58
switching to, 42–43
root level of drives
contents of, 7
startup files for, 346
rooted scrolling, 223
rotating photos, 73
routers, 375–377
as firewalls, 508–511
and IP addresses, 406–407
rules, firewall, 508, 513, 515
running applications, root account for, 37–40, 37–38


Index_S

Team LiB

Index

S

Safari browser, 379–380, 380
safe startup, 139–140
SafeShred utility, 538
Salling Clicker program, 371
Samba server, 413–417
Samba support for printers, 465
Save dialogs
Default Folder X for, 249, 250
navigating, 245–249, 246
for non-boot volume access, 615
Save To option, 497
saving
print job settings, 487–488
Terminal settings, 577
TextEdit documents, 301
updates, 160–161
Scale Effect, 253
Scanner tab, 290
Schedule tab, 83–84
scheduled backups, 569–570, 570
scratch files, 557, 621
screen, locking, 522–523
Screen Effects pane, 522–523
Screen Saver tab, 73–78
screen savers, 73–75
animated, 78–79
favorites, 76–77
installing, 75
location of, 153
for photo slide shows, 75
for screen locking, 522
slide show, 77
screenshots, 288, 313–315, 315
Script Editor application, 296
Script Menu, 226
Scripting Additions folder, 347
scripts
cleanup, 553–555, 554
for DVD Player, 288
for keyboard shortcuts, 90
in Unix, 592–593, 597
ScriptSaver screen saver, 77
scroll bar arrows, 68, 69
Scroll to here setting, 67
scrollback buffers, 575
scrolling
in Finder, 227
rooted, 223
smooth, 67–68
Search function for files, 238–239, 239
searching
with browsers, 378–379, 380
for files, 238–244, 239–240, 243
in PDF files, 293, 293
in Unix, 585–586
SECONDS variable, 589
Secure FTP (SFTP)
for location files, 443–444
server connections in, 437–441, 439–440
sharing with, 410–412, 412
secure notes for Keychain items, 527
secure shell (SSH) protocol
for Remote Login, 434
in SFTP, 410–412, 412
security
auto-logouts, 521
basics for, 503–506
for deletions, 537–538
encryption for, 533–537, 534
for Fast User Switching, 32–33
Keychains for. See Keychains
locking screen, 522–523
for networks and Internet, 506–507. See also firewalls
for panes, 66
passwords for, 504–505, 518–520
preferences for, 80
single-user mode, 520–521
viruses, 539
Security Method setting, 416
Security pane, 80, 507
Seeing tab, 99–100
Select a Destination screen, 151, 151
selective printing, 493
Self-Monitoring Analysis & Reporting Technology (SMART), 552
sending faxes, 494–496, 495
Separator item on toolbar, 209
Server Info String setting, 416
Server Message Block/Common Internet File System (SMB/CIFS) protocol, 413
Server NetBios Name setting, 416
servers
addresses for, 426
connecting to, 426–428, 445–446
FTP/SFTP, 437–441, 439–440
for networking, 386
ports for, 407, 425
in URLs, 425
VNC, 454–456, 455
Service Menu Manager pane, 328
services
disabling, 134, 135
for logins, 131–135, 133, 135
ports for, 510
in security, 505
for text, 325–328, 326
set command, 586–587
Set Root Password dialog, 40–41
SetFile command, 197
Settings tab, 370
Setup Assistant, 304–305, 514, 514
Setup utility, 173
SFTP (Secure FTP)
for location files, 443–444
server connections in, 437–441, 439–440
sharing with, 410–412, 412
sftp-server application, 412–413
Share My Desktop program, 454–456, 455
Shared folder, 390–391
shared menus in URL Manager Pro, 383
Shared option for Windows File Sharing, 417
sharepoints and SharePoints utility, 403–404
for groups, 50–51, 51
for Guest access, 400
in Personal File Sharing, 404
in Windows File Sharing, 415–417
shares and sharing, 389–390
access in, 391
aliases in, 441–442
Bluetooth for, 392–394, 394
compressing files for, 398
fax machines, 496
with FTP, 405, 408–410, 437–441, 439–440
with iDisk, 394–397, 396, 428–432, 429–430
in Image Capture, 290–292, 291
Internet location files for, 442–445, 443, 445
IP addresses for, 406–408
at login, 434, 445–446
mounting and unmounting, 426
multiple volumes for, 391, 618
in networking, 373, 373, 375–377
NFS, 441
non-boot volumes, 618
with Personal File Sharing. See Personal File Sharing
with Personal Web Sharing, 419–421, 420
printers, 465, 482–485
quick access to, 422, 422
with root and admin, 392
servers for. See servers
with SFTP, 410–412, 412, 437–441, 439–440
Shared and Public folders for, 390–392
with SMB, 413–417, 417
Windows, 435–437
Sharing pane
for firewalls, 511, 512
for Internet routers, 376
for Remote Login, 448
Sharing tab, 290
SharingMenu program, 422, 422
shell scripts in Unix, 597
shells in Unix, 580–582, 592–593
Sherlock application, 296–299, 297
Short Name field, 24
short usernames, 53–58
shortcuts
keyboard, 87–91, 89
in Terminal, 576
for text, 323, 328–330
Show all file extensions option, 200
Show Classic status in menu bar option, 340
Show Completed Jobs screen, 496
Show Desktop program, 204
Show Hot Picks movie automatically option, 295
Show icon preview option, 203
Show Info window, 472
Show item info option, 203
Show Jobs window, 467–469, 468
Show Package Contents feature, 165
Show Password Hint after Three Attempts to Enter a Password option, 121
Show the "Other..." user option, 123
Show these items on the Desktop option, 198–199
Show warning before emptying the Trash option, 200
Shredder utility, 538
Shut Down option, 122
sidebars, 212–213, 212
customizing, 213–215, 214
recommended items on, 215–216
SideTrack utility, 90
Simple Finder mode, 26–27
single-user mode, 20–21, 138–139, 520–521
Sites folder, 8, 420
size, sidebars, 214–215
Skin a Dock program, 254, 256, 256
skins for Dock, 256, 256
SkipFolders file, 243–244
Sleep tab, 83–84, 522
slides and slide shows
creating, 77
Mac Slides Publisher application, 292
screen savers for, 75
SMART (Self-Monitoring Analysis & Reporting Technology), 552
Smart ScrollX utility, 90
SMB
for location files, 443–444
remote sharing with, 413–417, 417
SMB/CIFS (Server Message Block/Common Internet File System) protocol, 413
SMB Mount dialog, 436, 436
SMB Properties tab, 415
smooth scrolling, 67–68
smoothing fonts, 68–69
Snap to grid setting, 202
Snapz Pro X utility, 315, 315
Snard utility
for menus, 268
for running applications as root, 37, 37
software installation, 148
add-ons, 152–156, 154–155
distribution in, 148–150
drag-and-drop, 152
installer packages for, 150–152, 151
operating system, 166–173, 167
parts in, 164–166, 166
restoring software, 163–166, 166
uninstalling, 173–178, 177
Unix software, 145
updates. See Software Update system
Software item in System Profiler, 319
Software Restore CDs, 163–164
software testing, user accounts for, 11
Software Update system, 156
for Classic Environment, 337
ignoring updates, 159–160
vs. manual updates, 161–162
for printer drivers, 460
Remote Login for, 452–453
saving and downloading updates, 160–161
System Preferences for, 97
working with, 157–159, 157–158
Some Limits mode, 25–26
Sonnet PCI X Installer, 183
Sound Effects tab, 91
sound in DVD Player, 288
Sound pane, 91–93
SoundHack utility, 92
source kits, 610
Space item on toolbar, 209
special characters in Unix, 582–583
special variables, 589–590
Speech pane, 97–98
Speech Recognition tab, 97
Speed Disk component, 551
spell-checking, 324, 325
split windows in Terminal, 576, 576
Spoken User Interface tab, 98
spring-loaded folders, 200, 232
Spring-loaded folders and windows option, 200
square brackets ([]) in Unix, 584–585
SSH (secure shell) protocol
for Remote Login, 434
in SFTP, 410–412, 412
Start/Stop tab, 338–341, 338
starting
Classic Environment, 352
print queues, 467–468, 474
startup
boot pane in, 117–119, 118
boot process, 111–112
in Classic Environment
files for, 344–347, 353
options for, 342
disabling services, 134, 135
Open Firmware in, 141–142
options for, 131–135, 133, 135
safe, 139–140
single user mode, 138–139
stopping and restarting processes in, 135–138, 136
verbose mode, 139
volume and system choices in, 113–117, 113–114
Startup Disk pane, 98, 113–114, 113
Startup Items pane, 126–128, 126
Startup Manager, 114–115, 114
startup scripts, 592–593
startup volumes, 454, 618
StartupSyringe utility, 119
static IP addresses, 405–406
Stationary Pad option, 193
status bars in Finder, 225–226
status menu in Classic pane, 340–341, 340
stdin in Unix, 594
stdout in Unix, 594
Stickies application, 299–300
Sticky Keys function, 100
StopExts file, 244
stopping
Classic Environment, 352
print queues, 467–468, 468, 474, 475
startup processes, 135–138, 136
StopTypes file, 244
storage on Dock, 261–262, 262
Stuffit Expander application, 148–149
substitution, command, 595–596
Suck In Effect, 253
sudo command
precautions with, 38
for root access, 36, 37
for system-level processes, 137
Summarize Service, 326, 327
support files, location of, 144
swap files, 549, 557, 627–628
SWIM 3 Floppy Driver, 184
switching
to root account, 42–43
between user accounts, 31–35, 31
synchronizing
backups, 569, 571
bookmarks, 383–384, 384
iDisks, 430
volumes, 564
system add-ons
installing, 153–156, 154–155
location of, 144–145, 152–153
system choices in startup, 113–117, 113–114
system domain, 12–13
System Folders
for Classic Environment, 344–347, 345, 354
startup files for, 346
in updates, 171
system initialization, 112
system-level processes, 137–138
system-level services, 135–136
system-level VNC servers, 455–456
system.log file, 306
System Manager utility, 348
System Manager X utility, 266
System Memory tab, 304, 304
System Preferences, 61–62, 62
Appearance pane, 67–69
for application appearance, 39
Bluetooth pane, 81, 86–87
CDs & DVDs pane, 81
Classic pane, 95, 337–344, 338, 343
Date & Time pane, 95–97, 96
Desktop & Screen Saver pane, 69–78
Displays pane, 82–83
Dock pane, 78, 252–253, 252
Energy Saver pane, 83–84, 84
Expose pane, 277–278, 277
for faxes, 494
for FileVault, 534
Finder, 103
for firewalls, 511
Ink pane, 85
international options, 78–80, 80
Internet & Network Preferences category, 93–95
Internet pane, 367–369, 369
Keyboard pane, 85–86
Keyboard Shortcuts tab, 87–91, 89
for logins, 122–125, 123
.Mac pane, 367–369, 369
Mouse pane, 86
for networks. See networks and networking
opening, 66–67
Others category, 100–102, 101–102
pane access in, 63–67, 63, 65
Panther vs. Jaguar, 70
personal preferences category, 67–69
preference files for, 105–109, 107
Print & Fax pane, 91
for printing, 470–471
for Remote Login, 448
for security, 80, 507
for sharing, 376
Software Update pane, 97, 155–156, 157–158
Sound pane, 91–93
Speech pane, 97–98
Startup Disk pane, 98, 113–114, 113
Trackpad tab, 86
Universal Access pane, 98–99, 100
for user accounts, 23, 27, 95
for user levels, 9
viewing options in, 62
System Profiler utility, 320–321
system swap files, 627–628
system variables, 588–589
SystemStarter utility, 137


Index_T

Team LiB

Index

T

tab key
in Expose, 279
in Unix, 583
tabbed browsing, 380
tail command, 595–596
tar tool, 596
TCP/IP printer drivers, 481–482
tcpdump command, 608
tcsh shell, 580
Tech Tool Pro 4 program
for defragmenting drives, 549
for directory problems, 544
for optimizing drives, 550
for recovering files, 547
for testing drives, 552
for undeleting data, 547–548
templates, editing, 9
temporary file storage, 233, 557
temporary folders on sidebars, 215
term variable, 590
Terminal application, 320
alternatives to, 577
for enabling root account, 40
for faxes, 499
for journaling, 546
login access to, 140–141
for NetInfo, 16–17
for non-boot volume access, 615–616
for printers, 462
for printing folder listings, 226
for root access, 36
for screenshots, 314
for startup volumes, 116
for System Profiler, 320
on toolbar, 216
for Unix, 575–577, 576, 579
terminal emulation programs, 575
test pages, printing, 473
testing
drives, 552
software, 11
text
automated, 328–330
cleaning up, 331
clippings for, 330
for file labels, 196
fonts for, 68–69, 153
multiple clipboards for, 328, 329
in Terminal, 576
working with, 323–328, 325–327
text banner in login screen, 129–130
text completion, 328–329
text editors
for printing folder listings, 226
in Unix, 604
TextEdit editor, 300–302, 302, 577
textSOAP program, 331
TextSpresso program, 331
TextWrangler editor, 593, 604
third-party firewalls, 516–517
third-party software
for directory problems, 544–545
drive cleaners, 178
installing. See software installation
uninstalling, 175–178
updates for, 161
third-party system-level services, 135
threads, 303
thumbnail drawer, 293
tildes (~) in Unix, 583
Timbuktu Pro program, 458
time, international options for, 79
Time Ballz screen saver, 77
Time Zone tab, 95
TinkerTool utility
for Dock, 254
for file visibility, 197
for font smoothing, 69
for scroll bar arrows, 68, 69
for unsupported hardware, 184
Title Bar icon, 225
title bars for applications, 282–283
titles in login screen, 130
Toast utility, 313
toolbars
appearance of, 64
for applications, 104–105, 105, 210, 282
contents of, 104–105, 105
customizing, 211, 211
displaying, 104
in Finder, 206–211, 207–208
traceroute command, 608
trackpad enhancements, 90
Trackpad tab, 86
transferring
Keychains, 530–531
operating system between computers and drives, 178–183, 180
Translation Service, 327
Transmit FTP/SFTP client, 438–439, 439–440
TransparentDock utility, 254–256, 255, 280
Trash in security, 537
Trojan horses, 516
troubleshooting
Classic Environment, 353–355
freezes, 320–322, 321
permissions, 46–47, 46
preference files, 108–109, 322
printing, 499–500
user accounts for, 10–11
troubleshooting utilities in Dock, 261
Turn on full keyboard access option, 87
TWAIN SANE program, 184
Type, Creator & Extension pane, 190, 191
TypeIt4Me program, 328–329
types for files, 189–192, 191
Typist program, 329–330


Index_U

Team LiB

Index

U

uControl utility, 90
uid property, 31
unalias command, 592
undeleting data, 547–548
undo feature, 244
UnErase function, 547
Uniform Resource Identifiers (URIs), 472
uninstalling software, 173–178, 177
Uninterruptible Power Supplies (UPSs), 84
Universal Access pane, 98–99, 100
universal access volumes, 617
Unix, 573
aliases in, 592
applications for, 598–599
auto-completion in, 583–584
benefits of, 573–574
command substitution in, 595–596
commands in, 581–582
compiling and installing programs in, 609–610
cron in, 604
customizing shells in, 592–593
disk utilities for, 608
editors in, 604
example solution, 599–603
files in, 596–597, 607–608
find command in, 585–586
globbing in, 584–585
help for, 604–606
installation file location for, 145
vs. Mac approach, 578–580, 578
Mac tools for, 604–605
network and Internet tools for, 608–609
paths in, 591–592
for PDF files, 491
porting programs in, 610–611
printing tools for, 609
redirection in, 594–596
shell scripts in, 597
shells in, 580–582
special characters in, 582–583
Terminal for, 575–577, 576, 579
types of programs in, 574
variables in, 586–590
X11 windowing environment for, 611
unlocking Keychains, 528
unmounting
removable volumes, 619
shares and volumes, 426
Unpopular utility, 385
unsupported hardware
printers
Classic Environment for, 478
supporting, 479–480
third-party support for, 183–184
Update tab, 94
Update Software tab, 157, 157–158
UpdateRadar update service, 161
updating
operating system, 166–173, 167
software. See Software Update system
UPSs (Uninterruptible Power Supplies), 84
URIs (Uniform Resource Identifiers), 472
URL Manager Pro program, 382–383, 383
URLs
e-mail for, 386
format of, 424–425
USB Overdrive X program, 183
USB printers
adding, 463–464
Gimp-Print drivers for, 481
Use Smooth Scrolling option, 67–68
user accounts, 6
creating, 23–27, 24
deleting, 29–30, 29
disabling, 30–31, 125
editing, 27–28
and file organization, 7, 7
hiding, 124–125
login options for, 120–125
no-password, 58–59, 59
root. See root account
in security, 504
startup options for, 126–128, 126
switching between, 31–35, 31
System Preferences for, 23, 95
user levels in, 9–10, 10, 27
usernames for, 53–58
uses for, 10–12
user domain, 14
user folders in updates, 169
user-level processes, 137–138
user-level services, 135–136
user-level VNC servers, 455, 455
user levels in user accounts, 9–10, 10, 27
User Template folder, 9
user templates, editing, 9
USER variable, 589
usernames
authentication dialogs for, 14
changing, 53–58
for logins, 120–121
Users folder, 7
Users tab, 120
utilities, 302
Active Monitor, 302–304, 304
AirPort, 304–305
for backups, 569–571, 570
Bluetooth Setup Assistant, 305
ColorSync, 305
Console, 305–306
DigitalColor Meter, 306–307
Directory Access, 307
Disc Burner, 307
Disk Utility, 308–313, 309
in Dock, 261
Grab, 313–315
iDisk Utility, 316
installation location for, 144
Installer, 316
Key Caps and Keyboard Viewer, 316–318, 317
Keychain Access, 318
for menus, 268–269, 269
Network Utility, 318
System Profiler, 320–321
Terminal, 320


Index_V

Team LiB

Index

V

Vanity Dockling application, 266
VaporSec program, 447
var folder, 171
variables, 586
setting and using, 586–587
special, 589–590
startup scripts for, 592–593
types of, 588–589
viewing, 587–588
verbose logging in Internet Connect, 373
verbose mode in startup, 139
Verify Disk function, 543
Verify field, 24
Version Tracker site
for contextual menus, 230
for screen savers, 75
VersionTracker Pro update service, 161
vertical bars (|) for Unix pipes, 594
vertical scrolling in Finder, 227
Veto Files option, 416
vi editor, 604
ViaVoice program, 330
Vicomsoft FTP client, 439
view options
for Desktop, 202–203, 202
in Finder, 103, 201, 216–223, 218–221, 223
in Image Capture, 289
in System Preferences, 62
viewing
Keychain items, 526–527, 526
variables, 587–588
virtual memory, 351
virtual network computing (VNC), 454
clients for, 456–458, 457
setting up, 454–456, 455
Virtual PC program, 561
virtual PostScript printers, 492
Virtual Private Network (VPN) connections, 372–373, 446–447, 447
VirusBarrier program, 539
viruses, 506, 539
Visage utility, 118
visibility of files, 196–197
vision impairments, features for, 98–99
visual beeps, 93
VNC (virtual network computing), 454
clients for, 456–458, 457
setting up, 454–456, 455
VNC Thing client, 456–457, 457
voice, defaults, 97
voice recognition software, 330
volume
of alerts, 92
changing, sound for, 92–93
of keyboard keys, 92
Volume menu, 91–92
volumes
in Dock, 261
mounting and unmounting, 426
multiple. See multiple volumes
for sharing, 391
in startup, 114–117, 114
startup, 454
unmounting and ejecting, 619
VPN Connection window, 447, 447
VPN (Virtual Private Network) connections, 372–373, 446–447, 447
VPN Tracker program, 447
VueScan program, 184


Index_W

Team LiB

Index

W

Watson application, 297–299, 297
wClock utility, 96
web browsers. See browsers
Web Confidential program, 532
Web pages, sharing iDisk files with, 397
Web-Sharing feature, 291, 291
WebDAV (World Wide Web Distributed Authoring and Versioning), 428
WebPrint Plus utility, 493
weekly script, 554
whatis tool, 604
whoami command, 42
whois command, 608
widgets, toolbar, 64
Wildcards in Unix, 584–585
windowing environments, 611
windows
accessing. See Expose
in browsers, 385–386
hiding, 273–274
minimizing, 261–262, 262, 273–274
in Terminal, 576, 576
Windows computers, sharing with
connecting to shares, 435–437
files, 413
access in, 413–415
alternatives to, 418
configuring, 413–417, 417
sharepoints for, 415–417
iDisk, 396–397
printers, 465, 484
WindowShade X program, 262
wireless networking
with Bluetooth
for sharing files, 392–394, 394
System Preferences for, 370–371
encryption for, 506
WordService program, 327
workflows in PDF, 490–491, 490
WorkGroup setting, 416
WorkStrip X program, 271, 271
World Wide Web Distributed Authoring and Versioning (WebDAV), 428
Write only permission, 6


Index_X

Team LiB

Index

X

X Colors dialog, 218–219
X11 item in System Profiler, 320
X11 windowing environment, 611
xBack utility, 78
xClock utility, 96
Xkeys utility, 90
XPostFacto program, 183
XRay utility
for file types, 190–191, 191
for group permissions, 53
for invisible bit, 196
for uninstalling packages, 178
XShelf utility, 233, 330
Xupport utility
for cleaning drives, 554
for firewalls, 513
for journaling, 546
for swap files, 628


Index_Y

Team LiB

Index

Y

Yadal utility, 267


Index_Z

Team LiB

Index

Z

Zero all data option, 538
Zero Configuration Networking standard, 374
zero device, 596
Zingg! plug-in, 233
Zip disks, 567
Zip files, 149
zooming rectangles, turning off, 106–108, 107
zooming TextEdit documents, 302, 302


List of Figures

Chapter 1: The Power of Permissions: Understanding Users and Unix Organization

Figure 1.1: The Ownership & Permissions section of the Info window for sample.doc
Figure 1.2: A typical home user folder
Figure 1.3: User levels, as shown in the Accounts panel of System Preferences
Figure 1.4: The system-level Library folder
Figure 1.5: The local-level Library folder
Figure 1.6: The user-level Library folder
Figure 1.7: User account settings in NetInfo Manager
Figure 1.8: Creating a new user account
Figure 1.9: Limiting the capabilities of a user
Figure 1.10: Deleting a user account
Figure 1.11: The Fast User Switching menu
Figure 1.12: Using Activity Monitor to quit an application in another user’s account
Figure 1.13: Using sudo to execute the rm (remove) command on a protected file
Figure 1.14: Running a Terminal session as root using sudo -s
Figure 1.15: Using Snard to launch (left) and authenticate (right) an application as root
Figure 1.16: Using Pseudo to launch (left) and authenticate (right) an application as root
Figure 1.17: A file’s permissions change when it’s copied
Figure 1.18: Using Disk Utility to repair disk permissions
Figure 1.19: Creating a new group, Adults, in NetInfo Manager
Figure 1.20: SharePoints can automatically provide the next available GID for you.
Figure 1.21: Changing the Group owner for a file using the Finder’s Get Info window
Figure 1.22: OS X warns you if your account doesn’t have a password.

Chapter 2: Sensational Setup

Figure 2.1: The System Preferences application
Figure 2.2: Adding a preference pane to the toolbar
Figure 2.3: Menuprefs provides a menu of preference panes right in the menu bar.
Figure 2.4: Using TinkerTool to improve your scroll bar arrows
Figure 2.5: Creating a new property in the preference file for Desktop Picture Collections
Figure 2.6: The Hot Corners configuration dialog of Screen Saver preferences
Figure 2.7: The Character Palette lets you choose any character in any font.
Figure 2.8: Energy Saver on a desktop (left) and a laptop (right)
Figure 2.9: Creating a new, system-wide, keyboard shortcut
Figure 2.10: You Control provides a convenient drop-down calendar.
Figure 2.11: KeyStrokes provides an on- screen keyboard for accessibility.
Figure 2.12: System Preferences’ Others, category after installing a new preference pane
Figure 2.13: System Preferences lets you decide at which level new preference panes are installed.
Figure 2.14: Customizing the Mail toolbar
Figure 2.15: Changing a Finder setting using PrefEdit

Chapter 3: Subjugating Startup and Leveraging Login

Figure 3.1: The Startup Disk pane of System Preferences
Figure 3.2: The Startup Manager utility
Figure 3.3: The default (left) boot panel image and a custom image (right)
Figure 3.4: LoginWindow Manager lets you access hidden login window options.
Figure 3.5: Using the Startup Items tab to automatically open frequently used items at login
Figure 3.6: Managing installed startup/login items using Diablotin
Figure 3.7: Using Boot Config to configure startup services
Figure 3.8: Using Activity Monitor to view the current user’s processes

Chapter 4: Installations, Inc.

Figure 4.1: The Contents folder of the Mail.app package
Figure 4.2: The Select a Destination screen in the Installer utility
Figure 4.3: Some installers ask whether you want the system add-on to be installed for the current user or for all users.
Figure 4.4: Using Alfred to install system add-ons
Figure 4.5: The Software Update pane of System Preferences
Figure 4.6: Updates available via the Software Update application
Figure 4.7: Ignoring an available update (making it inactive)
Figure 4.8: The contents of the Mac OS X 10.3.1 updater package as viewed in Pacifist
Figure 4.9: The Archive and Install option of OS X 10.2 and later
Figure 4.10: DeLocalizer lets you remove unwanted language support
Figure 4.11: Selecting a package to uninstall with DesInstaller
Figure 4.12: Using Carbon Copy Cloner to copy a Mac OS X volume

Chapter 5: Finagle Files and Foil Finder Frustration

Figure 5.1: A document’s application associations as shown in XRay
Figure 5.2: An application’s Type, Creator & Extension window in XRay
Figure 5.3: The Preview panel for (left to right) a text file, an MP3 file, and a QuickTime movie
Figure 5.4: The General panel of the Finder Preferences dialog
Figure 5.5: View Options for the Desktop
Figure 5.6: Accessing the Desktop folder in the Dock
Figure 5.7: Creating a Desktop menu in MaxMenus
Figure 5.8: The default Finder window toolbar in OS X 10.3 (top) and the same window with the toolbar hidden (bottom)
Figure 5.9: The Customize Toolbar dialog
Figure 5.10: Adding an item to the Finder window toolbar
Figure 5.11: The sidebar automatically resizes items as you add more.
Figure 5.12: Adding an item to the sidebar
Figure 5.13: View Options for icon view
Figure 5.14: A folder of pictures viewed using large icon previews
Figure 5.15: Viewing a folder’s contents in list view
Figure 5.16: View options for list view
Figure 5.17: The preview column for a QuickTime movie file
Figure 5.18: View Options for column view
Figure 5.19: Contextual menus for a file, a folder, a volume, an application, the Desktop, and inside a folder (from left to right, first row, then second)
Figure 5.20: The Finder allows you to authenticate restricted actions.
Figure 5.21: Changing the focus of the Search field
Figure 5.22: A complex Find
Figure 5.23: Locator provides a nice interface for the locate command.
Figure 5.24: The Content index panel for a folder
Figure 5.25: In OS X 10.3 and later, Open/Save dialogs (top) closely resemble Finder windows (bottom).
Figure 5.26: Default Folder’s volume menu

Chapter 6: Developing a Dynamite Dock

Figure 6.1: The Dock preference pane
Figure 6.2: A QuickTime movie playing in the Dock
Figure 6.3: Dock Setup options in TransparentDock
Figure 6.4: Dock-o-rama: the stock Dock; a transparent Dock created using Transparent-Dock; and a Dock skinned using Skin a Dock (top to bottom)
Figure 6.5: iTunes’ Dock menu
Figure 6.6: Windows minimized to the Dock
Figure 6.7: Mac OS X’s application switching display
Figure 6.8: Some Dock-based applications
Figure 6.9: Using MaxMenus to open an Acrobat document using Preview
Figure 6.10: LaunchBar (left) and LaunchBar’s results listing (right) after typing net on my computer
Figure 6.11: Some Dock alternatives: DragThing (top) and WorkStrip X (bottom)

Chapter 7: Application Aptitude

Figure 7.1: The all windows mode of Exposé
Figure 7.2: The application windows mode of Exposé
Figure 7.3: The Desktop mode of Exposé
Figure 7.4: The Exposé pane of System Preferences
Figure 7.5: The alternate Desktop mode (in the lower left corner) and the Exposé “floater” (lower right)
Figure 7.6: DVD Player’s advanced controls
Figure 7.7: The Download Some screen of Image Capture
Figure 7.8: Accessing a shared digital camera via Image Capture’s Web-Sharing feature
Figure 7.9: Preview’s search function finds and lists all occurrences of your search term.
Figure 7.10: Sherlock’s channels
Figure 7.11: Watson, Sherlock’s more capable twin
Figure 7.12: Using TextEdit’s zoom function
Figure 7.13: Activity Monitor’s main window, displaying user-level processes and, via the System Memory tab, memory usage
Figure 7.14: Disk Utility provides you with basic (top) and detailed (bottom) information about a drive.
Figure 7.15: Snapz Pro X offers more options than Mac OS X’s own screenshot functionality.
Figure 7.16: Using Key Caps in OS X 10.2 (top) and Keyboard Viewer in OS X 10.3 (bottom) to view characters in the current font that are accessible via the option key
Figure 7.17: The Force Quit Applications window
Figure 7.18: Mac OS X’s word suggestion feature
Figure 7.19: Using Services to transfer text from TextEdit to a new note in DEVONthink
Figure 7.20: Using the Summarize Service, it’s possible to make the Gettysburg Address even shorter.
Figure 7.21: You Control’s multiple clipboards

Chapter 8: Clobbering Classic

Figure 8.1: The Start/Stop pane of Classic preferences
Figure 8.2: The “Warn before starting Classic” dialog
Figure 8.3: The Classic status menu shows you if Classic is stopped (left) or running (middle). It also lets you quickly start and stop Classic and access the Classic Apple Menu (right).
Figure 8.4: The Memory/Versions tab of Classic preferences
Figure 8.5: Using Conflict Catcher to manage Classic startup files
Figure 8.6: The menu bar for the shareware text editor Tex-Edit Plus in OS X (top) and Classic (bottom)
Figure 8.7: You can launch the Palm Desktop application as either an OS X or a Classic application.

Chapter 9: Networking Notables and Internet Illuminations

Figure 9.1: Using the Network Port Configurations dialog to disable unused network interfaces
Figure 9.2: Location X changes various settings when you switch “locations”
Figure 9.3: Using More Internet to assign applications to Internet protocols and file types
Figure 9.4: Internet Connect’s Summary screen provides an “at a glance” look at your connection options.
Figure 9.5: iSeek lets you search many different sites and search engines quickly and easily.
Figure 9.6: Tabbed windows in Safari
Figure 9.7: A homemade menu of bookmarks/favorites in the Dock
Figure 9.8: URL Manager Pro’s Dock (left) and menu bar (right) menus
Figure 9.9: Bookit lets you synchronize the book- marks of all your browsers.

Chapter 10: Stellar Sharing Strategies

Figure 10.1: Selecting a device to which to send a file via Bluetooth
Figure 10.2: Using iDisk Utility to control access to your Public folder
Figure 10.3: Enabling Personal File Sharing in Sharing preferences
Figure 10.4: Setting up a File Sharing Only user in SharePoints
Figure 10.5: Using NetInfo Manager to limit a user’s Remote Login capability to SFTP
Figure 10.6: SharePoints allows you to configure various properties for your Windows File Sharing server.
Figure 10.7: A default user web- site in OS X
Figure 10.8: SharingMenu gives you quick access to Sharing services.

Chapter 11: Connection Convenience and Remote Control

Figure 11.1: The Finder’s “Other User’s Public Folder” connection dialog lets you easily connect to iDisk Public folders.
Figure 11.2: The Connect To iD- isk dialog
Figure 11.3: The Network view shows local servers.
Figure 11.4: Connecting to Personal File Sharing shares
Figure 11.5: The SMB Mount dialog lets you choose to which Windows (SMB) shares you want to connect.
Figure 11.6: Using Transmit to connect to another computer via SFTP
Figure 11.7: Transmit shows you “your stuff” and “their stuff” when connecting to an FTP or SFTP server.
Figure 11.8: Internet Location files for (left to right) a remote Personal File Sharing server, a local Mac running Personal File Sharing, and an FTP server
Figure 11.9: Accessing favorite servers via the Dock
Figure 11.10: Mac OS X’s VPN Connection dialog box
Figure 11.11: Share My Desktop shows you everything you need to know to connect to the local VNC server.
Figure 11.12: A VNC client/server connection lets you control one Mac from another.

Chapter 12: Printing Practicalities (and Fax Features)

Figure 12.1: The Printer List window of Printer Setup Utility
Figure 12.2: Stopping a printer queue via the Show Jobs window
Figure 12.3: CUPS’ printer administration Web page
Figure 12.4: Active (top) and stopped (bottom) printers in the CUPS Web interface
Figure 12.5: The PDF workflow pop-up menu includes whatever items you’ve placed inside the PDF Services folder(s).
Figure 12.6: The Fax dialog, accessible from the Print dialog
Figure 12.7: Mac OS X’s fax reception options
Figure 12.8: Fax Alert Installer uses a Folder Action script to let you know when a new fax has been received.

Chapter 13: Strengthening System Security and Fine-Tuning Firewalls

Figure 13.1: The port mapping settings for a Mac- sense Internet router
Figure 13.2: Mac OS X’s firewall preferences
Figure 13.3: BrickHouse’s Setup Assistant lets you add less common services to your firewall rules.
Figure 13.4: You can deny or allow an application access to your Keychain.
Figure 13.5: Keychain Access lets you view and edit Keychain items.
Figure 13.6: The Password Assistant window tells you if your new password could be better.
Figure 13.7: Keychain First Aid found problems with this Keychain.
Figure 13.8: Mac OS X points out the importance of remembering your password when using FileVault.

Chapter 14: Mac Maintenance and Administrative Actions

Figure 14.1: A graphical representation of disk fragmentation (courtesy of Drive 10)
Figure 14.2: The volume from Figure 14.1 after being defragmented
Figure 14.3: MacJanitor lets you manually execute OS X’s periodic maintenance scripts.
Figure 14.4: A sample crontab entry in CronniX
Figure 14.5: Creating a new cron task in CronniX
Figure 14.6: ProcessWizard lets you “renice” any running process.
Figure 14.7: LogMaster provides advanced log viewing features.
Figure 14.8: Data Backup X’s main window lets you easily configure and run backup actions
Figure 14.9: Déjà Vu’s backup scheduler is simple to set up.

Chapter 15: Utilizing Unix

Figure 15.1: Moving a file to the Desktop using the Finder (top) and Terminal (bottom)

Appendix A: Multiple Mounts, Various Volumes, and Divided Disks

Figure A.1: Disk Utility warns you that partitioning erases any volumes on the disk being partitioned—this erasure cannot be undone.
Figure A.2: An example of partitions: two physical drives partitioned into five volumes


List of Tables

Chapter 7: Application Aptitude

Table 7.1: Comparing the “Stock” Plug-ins of Sherlock and Watson

Chapter 11: Connection Convenience and Remote Control

Table 11.1: Common Location File (URL) Formats
Table 11.2: Location File Formats, Including Passwords
Table 11.3: Common Commands Used via Remote Login

Chapter 15: Utilizing Unix

Table 15.1: Some Basic Shell Commands


List of Sidebars

Introduction

What’s a Sidebar?

Chapter 1: The Power of Permissions: Understanding Users and Unix Organization

What Permissions Really Mean
Dissecting the Contents of Your Home Directory
Understanding Authentication Dialogs
Panther vs. Jaguar: Working with Accounts
Panther vs. Jaguar: Account Passwords
Sudo Caution (Not Pseudo Caution)

Chapter 2: Sensational Setup

Panther vs. Jaguar: Panther vs. Jaguar: System Preference Panes
Fave Savers
Keyboard Shortcut Symbols
Keyboard/Mouse/Trackpad Enhancements
Keys Used by Mouse Keys

Chapter 3: Subjugating Startup and Leveraging Login

Panther vs. Jaguar: Login Password Hint Options
If a User Forgets Their Password
Panther vs. Jaguar: Login Items vs. Startup Items

Chapter 4: Installations, Inc.

Internet-Enabled Disk Images
“Software Update” for Third-Party Software?
Panther vs. Jaguar: Installing Saved Updates

Chapter 5: Finagle Files and Foil Finder Frustration

Column View: Be Careful What You’re Moving
Column View and the Sidebar/the Toolbar/Go to Folder: “Rooted” Scrolling
Getting Window Settings to Stick
Open vs. Save Dialogs

Chapter 7: Application Aptitude

The Three C’s of OS X Applications
Panther vs. Jaguar: Where Did My Utilities Go?
Panther vs. Jaguar: Disk Copy Bites the Dust

Chapter 8: Clobbering Classic

Where to Put the Classic System Folder
OS 9 Startup Files Required for Full Classic Functionality
How Can I Tell If Classic Is Running?
Classic Applications and Memory

Chapter 9: Networking Notables and Internet Illuminations

IP over FireWire
Panther vs. Jaguar: Internet Preferences
Midnight (or Any Other) Rendezvous

Chapter 10: Stellar Sharing Strategies

Root and Admin Access and Sharing
When to Compress/Encode Files for Sharing: File Sizes and Resource Forks
Your IP Address: Internet Routers, Port Caveats, and Dynamic IPs
Network File System (NFS) Sharing (and Connecting)

Chapter 11: Connection Convenience and Remote Control

The Connect To Server Dialog
Keeping a “Local” Copy of an iDisk
Accessing Personal File Sharing: Normal versus Admin Users
Network Browsing versus Connect To Server: OS X 10.3.0 - 10.3.2

Chapter 12: Printing Practicalities (and Fax Features)

Where Are the Printer Drivers?
Your Mac’s Rendezvous Name and Printer Sharing

Chapter 13: Strengthening System Security and Fine-Tuning Firewalls

The Security Pane of System Preferences
Port Portals: Common Ports Used by OS X Services
Firewall Rules Explained
OS X’s Default Firewall Rules

Chapter 14: Mac Maintenance and Administrative Actions

Journaling: Your Drive’s Personal Diary
Make Your Own Bootable Utility CD

Chapter 15: Utilizing Unix

The Terminal Utility: Your Door to the Unix World
The Power of the Shell (i.e., Why Use Terminal?): An Example
Panther vs. Jaguar: Default Shells (i.e., bash vs. tcsh)
Hiking Club Solution
Tips for Mastering the Shell

Team LiB
Previous Section